LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Keep file rights with samba share (https://www.linuxquestions.org/questions/linux-server-73/keep-file-rights-with-samba-share-662701/)

eRJe 08-14-2008 04:10 AM

Keep file rights with samba share
 
Hi there,

I'm trying to set the file & directory rights in a users home directory permanently. The home directory is a Samba share and when users make changes to a file in Windows, the file rights are being changed. I don't want this to happen.

I've managed to get the group fixed but after changing the file in Windows, the file rights are changed to read-only for the group. If I could fix this, I would also be happy.

What I'm trying to accomplish here is setting up a (linux)user who's home directory is used to share documents between all other users. I did noticed that you can force Samba to set the rights to a specific user:group but then this would apply to all homes which not good.

Setting up a non-home directory as public share would probably be the easiest way but I would prefer using the home of an user.

Does anyone have an idea how I could do this?

Thanks,
Robbert

jschiwal 08-14-2008 06:54 AM

Giving a group of users read/write access to a users home directory is not a very good idea.
You could create a directory to share and create a symbolic link to it for this user.

There is a USERSHARES section of the smb.conf manpage. One of the options may be useful. I don't know if the users who log in are authenticated or not. With "Map to Guest = Bad User", an unauthenticated user will be mapped to "guest" which in Linux is the "nobody" user. The directory being shared needs permissions to allow writing by the authenticated user or the group or "Guest" for non-authenticated users. "Guest OK = Yes" needs to be used to allow access to a guest user. "Read Only = No" is needed to allow writing. An authenticated user need to be a Linux user as well, and the default umask setting might come into play as well.

The Samba windows permissions can't be greater than the Linux permissions. Also check the "Create Mask =" setting.
The default is 0744. Also check for a "force create mode" which may enforce read-only settings on created files.


All times are GMT -5. The time now is 08:39 PM.