Well, this isn't going to work. As you noticed. After all your share is owned by root and you aren't designating a guest user.
The proper method is to provide a guest user guest account = ...
(johndoe
below).
This is a working configuration:
$ testparm -s
# Global parameters
[global]
dns proxy = No
guest account = johndoe
log file = /var/log/samba/log.%m
map to guest = Bad Password
max log size = 1000
panic action = /usr/share/samba/panic-action %d
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
passwd program = /usr/bin/passwd %u
security = USER
server role = standalone server
server string = %h server (Samba, Ubuntu)
workgroup = NULL
idmap config * : backend = tdb
[share]
force create mode = 0660
force directory mode = 0770
guest ok = Yes
guest only = Yes
path = /share
read only = No
The second setting you may want to consider is guest only = ...
(depends on what you really want to achieve). I have found that leaving out the force directory mode
and force create mode
caused issues for me. Oh and don't forget to chown -R johndoe: ...
your share (replace the user name 😉).
Long story short:
Adjust ownership of the share on the server. Then:
[global]
# ...
map to guest = bad password
security = user
guest account = johndoe
[share]
path = /share
writable = yes
guest only = yes
guest ok = yes
force directory mode = 0770
force create mode = 0660
... does the job for me. That is, it allows anonymous wrtie-access to shares for anyone. The main difference to your configuration is the setting of the protocol level.
General Samba troubleshooting advice
On the server side:
- Use
testparm -s
to determine the effective settings used by Samba. This is also useful to give when asking questions and prevents redacting crucial information. Also, it strips empty lines and comments.
- Comment out what you don't use. So if you don't use CUPS printing, comment out the options for shares
[print$]
and [printers]
.
- Make sure to restart the Samba daemon (
smbd
) and for good measure (especially name-related settings) also restart nmbd
.
- Check user and group ownership of the shared folder.
- To rule out firewall-related issues use
smbclient
with localhost
(this could fail if you don't have Samba listening on the loopback adapter!).
On the client side:
- Use
smbclient
from Linux. I find its error messages more explicit.
- On Windows try
net use
, if you have to.
- Ensure that
ping
and such stuff works, in case a firewall might interfere. Also an nmap
run may be enlightening.
Please note that the above setting is tried and tested with Windows 10 Pro (2004). No SMB1-compatibility is required. This has been tested (server-side) on several generations of Debian and Ubuntu machines and on the client side with Windows 7 and various Windows 10 as well as various Linux clients.
smbclient
fromlocalhost
?