Samba share read only for guests, read write for authenticated users

Is it possible to have a samba share read only for guests, and read write for authenticated users?

If I put guest ok on an share then I am not prompted for a password, and effectively logged as guest with read only rights. But I want to be authenticated so that I can also write.

Could anyone provide a sample smb share stanza to achieve this?


Edit /etc/samba/smb.conf

# command line
sudo -e /etc/samba/smb.conf

# graphical
gksu gedit /etc/samba/smb.conf

Add in the write list paramter to your share definition, add in your list of users allowed write access.

write list = user1 user2 user3

You can use read list as well

read list = guest, nobody

So ...

[share]
comment = Ubuntu Share
path = /your/samba/share
browsable = yes
guest ok = yes
read only = yes
write list = user1 user2 user3
create mask = 0755

If you need finer grain of control, you can use acl (access control lists) on the server.


Read only parameter is a Boolean value, so this should be more like one of the following:

[share]
comment = Ubuntu Share
path = /your/samba/share
browsable = yes
guest ok = yes
read only = no
read list = guest nobody
write list = user1 user2 user3
create mask = 0755

[share]
comment = Ubuntu Share
path = /your/samba/share
browsable = yes
guest ok = yes
read only = yes
write list = user1 user2 user3
create mask = 0755