-   Linux - Newbie (
-   -   Samba write list not working as expected (

axedre 11-24-2009 05:09 AM

Samba write list not working as expected
Hello everyone! This is my first post here.
The question is pretty simple, but I haven't found the answer yet neither by googling nor on this forum.
I have a directory in my home folder which I want to use to share files. The folder must not be public, so I created a user named 'smbguest', along with a password. Then I wrote this in my smb.conf file:

path = /home/andrea/Share
valid users = andrea smbguest
browseable = yes
writeable = yes
write list = andrea smbguest

However, if I login to the share (Nautilus=>smb://localhost/share) with username andrea, I can correctly write files; if I login with the smbguest user, I cannot write files. Why is this so, since I added smbguest to the write list?
Thanks in advance,

P.S. uname -a returns "Linux notebook 2.6.28-15-generic #52-Ubuntu SMP Wed Sep 9 10:49:34 UTC 2009 i686 GNU/Linux", in case it helps.

maslik 11-24-2009 10:38 AM

Hm, does the user smbguest has a right to write that folder in your system? You may try

chmod 777 /home/andrea/Share
as an ultimate solution.

axedre 11-24-2009 04:32 PM

Hi and thanks for the reply! I actually saw your reply by "accident" since I hadn't turned e-mail notifications on (I thought they'd be on by default).
These are the permissions on the 'Share' folder:


andrea@notebook ~ $ ls -lA | grep Share
drwxr-xr-x  2 andrea andrea  4096 2009-11-24 23:21 Share

So I suppose it means the folder is owned by me (duh! :)) both as user and group, whereas smbguest has:


andrea@notebook ~ $ more /etc/passwd | grep smbguest
smbguest:x:1001:1001:Samba guest account:/dev/null:/dev/null

Giving 777 permissions to the folder is clearly a solution (which I tried, and of course it worked - tried creating an empty folder inside Share and it created it with smbguest:nobody ownership) but I was actually looking for a more elegant solution, and honestly I thought adding smbguest to the share's write list in smb.conf would do the trick.
In fact, why is there even a "write list" property if, ultimately, the user itself must have the permissions matching those of the folder? Any other suggestions?
Thanks in advance.


axedre 11-26-2009 07:59 AM

Up! :)
I thought... would adding smbguest to my group (andrea) help in any way? And then setting 775 permissions to the Share folder.
If I could avoid changing the default folder permissions it'd be great!


jschiwal 11-26-2009 08:17 AM

Since there is only one other user to add to the write list, you might consider using setfacl to add an acl allowing the user smbguest write access to the directory. The disadvantage of adding smbuser is that that user would then have group access to other directories which have "andrea" group ownership.

# set default facl that is inherited by all files & directories created (only do this if that is what you want)
sudo setfacl -m d:u:smbuser:rwx <directory>

# set the facl on the directory itself. (setting the default won't give permission on the directory itself or old files)
sudo setfacl -m u:smbuser:rwx <directory>

All times are GMT -5. The time now is 02:45 AM.