sharing a folder with samba as RO to guests and RW to admin

I had a folder on my linux machine that I would like it to be shared as RO to any guest without password requirement but as RW to myself so that (by providing a user/pass) I would be able to alter its contents

The first thing that must be noted is that samba does not allow to share the same folder more than once! So the solution to that was to create a link to this folder and share the original folder as RW for an admin and share the link as RO to everyone else

So if /MYFILES is the original folder you need to do this

ln -s /MYFILES /MYFILESlink

Next use this smb.conf :

[global]
workgroup = WORKGROUP
netbios name = FILESERVER
server string = samba ver. %v

security = user
encrypt passwords = true
map to guest = bad user
guest account = nobody

passdb backend = tdbsam
obey pam restrictions = yes
invalid users = root

[myfilesADM]
comment = Private Share
path = /MYFILES
browseable = no
read only = no
create mask = 0644
directory mask = 0755
valid users = adminuser


[myfiles]
comment = Public Share
path = /MYFILESlink
read only = yes
guest only = yes
guest ok = yes

Advertisement

Tags: , ,

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 )

Connecting to %s


Follow

Get every new post delivered to your Inbox.