Public writable Share in samba

Samba is used to create shared folders that can be accessed via windows machines.

Often, I get issues with creating public writable shares.

Here is my configuration of /etc/samba/smb.conf to create a public writable share.

 

This works only on samba 3.

———–

[global]
workgroup = WORKGROUP
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
security = share
encrypt passwords = true
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
map to guest = bad user
guest account = nobody
load printers = yes
printing = cups
printcap name = cups
usershare allow guests = yes

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = yes

[printers]
comment = Printer in Linux
path = /var/spool/samba
guest ok = Yes
printable = Yes
use client driver = Yes
browseable = No

[myshare]
path = /share
browsable = yes
writable = yes
read only = no
guest only = yes
create mask = 0644
directory mask = 0755

————

Just replace this content in smb.conf
replace [myshare] with your share name
replace /share with your path.

Just gave “chmod -R a+rwx” for /share path to ensure that it is writable by all.

 

Samba 4:

 

[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = samba
security = user
map to guest = bad user
guest account = nobody
usershare allow guests = yes
name resolve order = bcast host
dns proxy = no
#log level = 2
#log file = /var/log/samba/samba.log
encrypt passwords = true
max mux = 1

[allaccess]
path = /samba/allaccess
browsable = yes
writable = yes
guest only = yes
read only = no
create mask = 0664
directory mask = 0775
force user = shrini
force group = samba
#public = yes

[secured]
path = /samba/secured
valid users = @smbgrp
guest ok = no
writable = yes
browsable = yes

8 thoughts on “Public writable Share in samba

  1. An outstanding share! I have just forwarded this onto a colleague who has
    been doing a little homework on this. And he actually
    bought me breakfast due to the fact that I discovered it for him…
    lol. So allow me to reword this…. Thank YOU for the meal!!
    But yeah, thanks for spending time to discuss this subject here on your blog.

  2. Would like to say thanks also, you saved me a lot of time. Was worried that the article would eb slightly outdated, but 4 years old and still holding strong!🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s