If you follow the FAQ link from JasonAzze, you will see there is a "map to guest" line which is also required, so you need both of these lines:
security = user
map to guest = Bad Password
I had the same problem as the OP, and I have tested that this solution works on Fedora 18
Answer from banjo67xxx on serverfault.comIf you follow the FAQ link from JasonAzze, you will see there is a "map to guest" line which is also required, so you need both of these lines:
security = user
map to guest = Bad Password
I had the same problem as the OP, and I have tested that this solution works on Fedora 18
I feel obligated to share this after spending hours trying to get this to work under SAMBA4 - here is my working SAMBA4 smb.conf that does NOT require a password to get to the share from windows
[global]
workgroup = HOME
server string = %h server (Samba, Ubuntu)
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
server role = standalone server
security = user
map to guest = Bad Password
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
usershare allow guests = yes
# VIDEO SHARE
[HD]
comment = HD Video Share
path = /RAID/HD
public = yes
writable = yes
available = yes
browsable = yes
guest ok = yes
create mask = 0777
directory mask = 0777
OK, I have found an answer myself.
As this is absolutely not obvious from the docs and HOWTOs and whatever, the reason this thing asks for password is because it cannot map guest user to the owner of the directory being shared.
I have NTFS partitions which I need to mount RW so I used the following setup in my /etc/fstab:
/dev/sdb1 /media/disk1 ntfs defaults,noexec,noatime,relatime,utf8,uid=1000,gid=1000 0 2
/dev/sdb2 /media/disk2 ntfs defaults,noexec,noatime,relatime,utf8,uid=1000,gid=1000 0 2
The most important pieces of config are uid and gid (maybe only uid, don't know).
They are set to the UID and GID of the user jonnie set up on the server (obviously not root). So, when ntfs-3g will mount these disks, everything will be owned by him.
After that, I have added this user to the Samba registry (or maybe created new identical one, don't care):
# smbpasswd -a jonnie
It asked for password, I have entered the same as for the main system.
After that, I have added the force user and force group settings to the smb.conf:
[global]
workgroup = WORKGROUP
netbios name = HOMESERV
security = user
map to guest = Bad User
[disk1]
comment = Disk 1 on 400GB HDD
path = /media/disk1
browsable = yes
guest ok = yes
read only = no
create mask = 666
directory mask = 777
force user = jonnie
force group = jonnie
[disk2]
comment = Disk 2 on 400GB HDD
path = /media/disk2
browsable = yes
guest ok = yes
read only = no
create mask = 666
directory mask = 777
force user = jonnie
force group = jonnie
So, most important piece of config relevant to me was force user.
Courtesy of the Samba HOWTO
The config can be shorter:
Create unix user jonnie
sudo useradd jonnie -s /usr/sbin/nologin
Create smbuser
sudo smbpasswd -a jonnie
Create the Linux directory to share
mkdir /mysmbshare
Change the owner of the directory to jonnie
sudo chown jonnie /mysmbshare
smb.conf
[global]
workgroup = MyWorkGroup
server string = Hello, use me
security = user
map to guest = Bad User
guest account = jonnie
passdb backend = tdbsam
[the_public_share]
path = /mysmbshare
writable = yes
printable = no
public = yes
All files are owned by jonnie and everyone has rw access to the files.