Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: File permissions using NFS

  1. #11
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    22,047

    Default Re: File permissions using NFS

    At the OP.

    I did not read all that is said above, but my idea is that you have some misconceptions.

    Permissions are not influenced at all by NSF, nor v.v. So when you understand them, then that works for all files, regardless if you cross a boundary in the directory tree to a mounted files system and thus also regardless if that mounted file system is of type NFS.

    When you want some place to put files where a group of users (in this case two users that are "owned" by you and your wife) must have read and write access, a good solution is to put those users in the same primary group (that may be "users", which is the default in openSUSE, but it may also be another one to protect them from again more users on the system) and those users must then have the r and w permission set for group (when those users have an umask set to 007 or less restrictive, that will be the case for most, if not all, newly created files).

    Of course the path to those files must also be accessable for those users. Thus all directories leading to them must have at least r-x permisions for e.g. the group (when the group is owning group) or for others.

    Example:
    Code:
    henk@boven:~> ls -l /home
    totaal 32
    drwxr-xr-x  6 mysql  mysql 4096  7 jun  2015 databases
    drwxr-xr-x 85 henk   wij   4096  4 dec 09:54 henk
    drwx------  2 root   root  4096 25 okt  2009 lost+found
    drwxr-xr-x 35 marian wij   4096 17 jun  2016 marian
    drwxr-xr-x 12 mgi    users 4096 28 nov 08:53 mgi
    drwxr-xr-x 17 smweb  www   4096 28 nov 08:40 smweb
    drwxr-xr-x  8 wappl  www   4096 18 jul  2015 wappl
    drwxrwxrwx 22 henk   wij   4096  1 dec 12:29 wij
    henk@boven:~>
    Two users henk and marian, primary group wij, each have their own home directory henk and marian.
    The directory wij (no need to have the same name as the group wij, but that seemed easy to me) is owned by henk (I choose one of the members of group wij) and group wij.
    Because this directory wij is rwxrwxrwx (rwxrwx--- would be enough in fact) everybody can search, add files, remove files, etc. in wij. Thus henk and marian can do the same things in wij as they can do in their home directories.
    When they then have at least rw-rw---- on files there and rwxrwx--- on directories the other can do the same as they can do themselves. Setting that can be done as said mainly by choosing a good umask, but of course also manualy, or by a crontab run (every 5 mins seems to be enough).

    Now over to NFS.
    Main thing here is that you should have the same userid for the same user on both systems (this is not about the usernames, but normaly you would also use the same usernames on both system to make living easy). Thus when you are 1000 on one system, you should also have 1000 on the other one. Same for your wife that e.g. has 1001 on both. The permissions work by userid and not by username.

    This is my export on the NFS server:
    Code:
    henk@boven:~> cat /etc/exports
    /home/wij       b*.henm.xs4all.nl(rw,sync,no_subtree_check)
    henk@boven:~>
    It exports /home/wij to all systems were the hostname start with a character b in the domain henm.xs4all.nl (tyou might want to simply use the IP address of the other system, or maybe just * for all systems that can connect).

    In the client's /etc/fstab:
    Code:
    boven.henm.xs4all.nl:/home/wij    /home/wij nfs    noauto    0 0
    So it is mounted on the same place as on the server (that is not a must).

    HTH. And of course ask if more info is wanted.
    Henk van Velden

  2. #12
    Join Date
    Dec 2008
    Location
    Montana, USA
    Posts
    470

    Default Re: File permissions using NFS

    Thank you much for the thorough reply. I'll try it and see how it works for me. Going to take a few days though, I'm up way too early and still up way too late. Busy, busy, busy!

    Bart

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •