Public Samba Share

I had a requirement to setup the samba share in a way that it does not
prompt for username and password. Some photos had to be shared across to
a wide group and I wanted to share the CD mounted on my system.

Google for setting up a "Public Samba Share", you will get lots of
discussions. This article finally helped.
Apart from your share configuration like:

#/etc/samba/smb.conf
[public]
comment = Public Campusnet Shares
browsable = yes
path = /data/pub
public = yes


Have these in the [global] section.


[global]
#...
guest account = nobody


Which defines the account to use when authenticating guests. Don’t forget to create this user using


# smbpasswd -an nobody


This will create the user with no password.

Now we have a perfectly valid Samba setup with a public share, but every time a user wants to access this share as a guest, he will have to do so by logging in as “nobody”. To complete our setup and imitate Windows behaviour, add the following line to the smb.conf global section:


[global]
#...
map to guest = bad user

No comments: