LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   NFS shared directory problem (https://www.linuxquestions.org/questions/linux-networking-3/nfs-shared-directory-problem-635781/)

'58LesPaul 04-16-2008 12:16 PM

NFS shared directory problem
 
Hello,

Here's what I need to have happen:

I have an Ubuntu 7.10 server setup running nfs server. I have a directory on the server called "shared" (permissions set to 777). This directory needs to be shared across the network AND must allow read and write access to all users of the "share" group. Users of the "share" group must also be able to edit each others documents in the "shared" directory.

This is what is happening:

On the client (Ubuntu 7.10 desktop)I have set up the server's "shared" directory to mount (through fstab) at bootup to the "shared" (permissions set to 777) directory on the client.

Here's the fstab line"

192.168.0.210 /shared /shared nfs rw,user,noauto,exec 0 0

The problem that I am having is this: When user_1 creates a document and saves it in the "shared" directory on the server, user_2, user_3, etc... need to be able to view and edit this document. But unfortunately user_2, user_3, etc... cannot edit the document. They can view it, but not edit it.

What am I missing here? What didn't I set up properly? Obviously somewhere I don't have the file permissions set right for the shared directory but I can't figure out where or what I need to do to share this directory with all users of the "share" group and allow them all read and write access to every document enclosed in the directory. Currently all users can read and write to the directory (their own files), but they cannot edit files created by other users.

Is there a way to strip the file permissions from each document as it is saved to the "shared" directory? Or is it possible to set the file permissions of each document to 777 as they are saved to the "shared" directory maybe through a setting in the fstab line?

Any help with this situation would be greatly appreciated.

Thanks
LP

jschiwal 04-16-2008 12:49 PM

What umask value do the users have?

You could set the sgid bit on the directory. Then the file will inherit the group ("shared") of the directory. If the users umask is 007, then the file will have read/write access for all users who are members of the "shared" group.

'58LesPaul 04-16-2008 04:27 PM

Quote:

Originally Posted by jschiwal (Post 3123243)
What umask value do the users have?

You could set the sgid bit on the directory. Then the file will inherit the group ("shared") of the directory. If the users umask is 007, then the file will have read/write access for all users who are members of the "shared" group.

Thanks for the reply. The umask value was set to 022. I changed it to 002 and now have read write access from all users of the group. Thank you!

Is it possible to have a umask value set in the fstab line for the NFS mount as opposed to having to change the umask value globaly in etc/profiles? That way only the files being saved to the shared directory will have the less secure permissions.

Thanks Again!
LP

jschiwal 04-17-2008 01:15 AM

Umask is a feature of the shell so it needs to be set when the user logs in. What kind of default group do the users have. Most distros create a group that is the same name as the user so the users default group is unique. That way there is no harm in having a umask value of 002.
On my system the users default group is "users". That is the first thing I noticed on SuSE and the first thing I changed.


All times are GMT -5. The time now is 07:24 PM.