Linux/Samba/Public Share

new root public share
[global] workgroup = WORKGROUP netbios name = SHARE server string = Guest File Server

security = user map to guest = Bad User guest account = root

follow symlinks = yes wide links = yes unix extensions = no

# Disable printers: load printers = no printing = bsd printcap name = /dev/null disable spoolss = yes show add printer wizard = no

[pub] comment = file share path = /pub browseable = yes read only = no guest ok = yes strict locking = no

Quick Public File Server
Summary: Guest access file server (no password, but may have to enter some random user name when windows asks for a username/password)

Install Samba: yum install samba apt-get install samba
 * 1) RHEL
 * 1) Debian

Add guest user (better to not use 'nobody' user): adduser guest

Create a share folder: mkdir /pub chown guest:guest /pub chmod g+ws /pub

Samba configuration files: /etc/samba/smb.conf

Note: "When it comes to "security = share" just say no!"

/etc/samba/smb.conf: [global] #default# workgroup = WORKGROUP netbios name = FILES server string = Guest File Server

#default# security = user #guest account = root guest account = guest map to guest = Bad User username map = /etc/samba/smbusers

## Follow symlinks #follow symlinks = Yes ## Follow symlinks outside of a share path wide links = Yes ## Support hard links, disable wide links unix extensions = No

## Disable printers: load printers = No       printing = bsd printcap name = /dev/null disable spoolss = Yes show add printer wizard = No

create mask = 0664 directory mask = 2775

[pub] comment = Guest access share path = /pub read only = No       guest ok = Yes force user = guest force group = guest

/etc/samba/smbusers: root = administrator admin guest = guest pcguest smbguest
 * 1) Unix_name = SMB_name1 SMB_name2 ...

Use 'testparm' to test configuration testparm testparm smb.conf

Restart Samba: service smb restart service samba restart
 * 1) RHEL
 * 1) Debian

Windows: (optional) net use \\files\pub /user:guest

Windows Access: \\files\pub
 * 1) may have to enter some random user name when windows asks for a username/password

References:
 * darkphader's ramblings: Samba and guest shares with "security = user" - http://blog.realcomputerguy.com/2010/12/samba-and-guest-shares-with-security.html

root public share
[global] workgroup = WORKGROUP netbios name = SHARE server string = Guest File Server

security = share guest account = root #guest account = nobody

follow symlinks = yes wide links = yes unix extensions = no

# Disable printers: load printers = no printing = bsd printcap name = /dev/null disable spoolss = yes show add printer wizard = no

[pub] comment = file share path = /pub browseable = yes # read only = yes (default) read only = no guest ok = yes strict locking = no

Note in Samba 4.2 the "security = share" is deprecated and replaced with: security = user map to guest = Bad User

Old Method
See Linux/Samba/Public Share/Old Method