Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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
share|improve this answer

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 only as well

read only = guest nobody

So ...

[share]
comment = Ubuntu Share
path = /your/samba/share
browsable = yes
guest ok = yes
read only = guest nobody
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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.