2

I have a folder in /var/www/html/ that people upload files to via PHP called store.

store has the permissions rwxrwxr-- it is owned by the user josh and the www-data group.

The store folder is also an SMB share and works if I use josh to login to it. However I need everyone to be able to access it but without write permissions as well.

This is what I have tried in my samba config:

[propellor]
path = /var/www/html/store
browsable = yes
guest ok = yes
read only = yes
write list = josh
create mask = 755

Mapping a network drive in Windows allows me to read and write if I use josh credentials but will not let me open the share at all if I am a guest or use another (Windows) user account.

I am missing something in my settings or permissions surly.

Thanks!

2 Answers 2

4

Create a new user first: sudo useradd samba-guest.

Search your smb.conf for guest account. Set this to samba-guest (guest account = samba-guest).

Now restart Samba and it should work.

For more info, please click here.

Note: don't forget to give samba-guest read permissions for /var/www/html/store.

3
  • How would I apply user specific permissions to a directory without overwriting the owner, group and existing permissions. Thanks.
    – joshkrz
    Apr 24, 2014 at 15:07
  • 2
    The easiest way is to give all users read permissions using chmod -R a+r /var/www/html/store/. Otherwise you could set the guest account to your own account and put read only = yes in your shares. Please note that I'm not a security expert but I think that'll do it. Apr 24, 2014 at 15:42
  • I think the samba-guest = josh with readonly did the trick. The chmod -R a+r didn't work for me. Thank you.
    – joshkrz
    Apr 25, 2014 at 12:02
0

You can use sticky for the other file permission in samba share file. or you can also add the guest user and change the permission for them on share folder.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .