Getting File permissions right on a network drive

Kernels & Hardware, configuring network, installing services

Getting File permissions right on a network drive

Postby sd_read » 2017-09-14 22:32

Hello, I am having problems with setting up permissions that I cannot seem to figure out even after exhaustive googling.

The problem is when I save photos from the camera to the network drive my Wife is not able to edit or create new files in that directory.

Here is my setup.

I have a Debian server with nfs running on it.

And on this server I have a second drive mounted as /mnt/bigdiskc.

I then export this entire disk on the server with the following entry in the /etc/exports file:

Code: Select all
 /mnt/bigdiskc 192.168.0.0/24(rw,sync,fsid=0,no_subtree_check)


Next, from my desktop client running Linux Mint and I have the following entry in my /etc/fstab file:

Code: Select all
192.168.0.6:/mnt/bigdiskc/Photos /mnt/photos nfs   rw,async,hard,intr 0 0


Where 192.168.0.6 is the server I mentioned above.

So on my client, Linux Mint desktop the above fstab entry mounts the Photos directory to:

Code: Select all
/mnt/photos


From my desktop I browse over to /mnt/photos/ where I create a new directory called “Test”.

Now I ssh into my server to look at the permissions for the directory I just created:

Code: Select all
4 drwxr-xr-x 2 steve users 4096 Sep 14 18:53 Test


The issue is that the group “users”. I can’t figure out why it only has read and execute rights.

How do I set it up so that when I created directories or save or copy files to this network disk it will not only give the owner (steve in this case) full rights but the group “users” as well.

Some more information, if I ssh into the server from the command shell as steve and then execute:

Code: Select all
mkdir Test2


in the same directory it works as I expect:

Code: Select all
4 drwxrwxr-x 2 steve users 4096 Sep 14 19:03 Test2


So this seems to be an issue with exporting the directory and mapping it to the client.

Also, my UID is the same for the server and client as well as GID.

This is a real pain as every time I copy camera photos over to the network drive I have to ssh into the server to change permissions for the group “user” so that my Wife can work with them.

Thank you for your help.
sd_read
 
Posts: 10
Joined: 2014-11-20 23:49

Re: Getting File permissions right on a network drive

Postby sd_read » 2017-09-19 22:18

No one can help me?
sd_read
 
Posts: 10
Joined: 2014-11-20 23:49

Re: Getting File permissions right on a network drive

Postby steve_v » 2017-09-20 12:00

What's your umask? same on the server and client?
If it's the default 022 on the client, those drwxr-xr-x permissions are what I would expect. I'm dubious as to NFS being the problem...

If the problem is the umask you'll have to set it in e.g. ~/.profile as NFS doesn't appear to support it per-mount. This will set the default for all new files created by the user.
A more refined approach might be to use ACLs on a per-directory basis, something like this.
steve_v
 
Posts: 472
Joined: 2012-10-06 05:31
Location: New Zealand

Re: Getting File permissions right on a network drive - SOLV

Postby sd_read » 2017-09-25 22:52

Yes, thank you, it was the umask.

On the server it was 0002 but on my client it was 0022 so I changed the ./profile as you suggested on my client, rebooted and now it works.

Thank you for your help.
sd_read
 
Posts: 10
Joined: 2014-11-20 23:49

Re: Getting File permissions right on a network drive

Postby Gaius » 2017-09-26 00:15

@ sd_read:

Renaming the OP to
[SOLVED] Getting File Permissions.....
will let other users who encounter the same problem know that a solution may be found in this thread.
:)

Cheers,
Gaius
If you can’t explain it simply, you don’t understand it well enough.
Albert Einstein
User avatar
Gaius
 
Posts: 32
Joined: 2012-12-18 10:54
Location: Germany


Return to System configuration

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable