Results 1 to 10 of 10

Thread: Make NFS share universally writable

  1. #1
    Join Date
    May 2009
    Location
    Fareham, UK
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Make NFS share universally writable

    I'm pretty new to most networking so please bear with me if I use the wrong terminology.

    I have a network of PC's at work which I wanted to connect with a shared documents folder to allow people to access documents anywhere. I found out about NFS which is new to me so thought I'd try it. I set up an NFS share on the server and all is running quite well, it's quite easy except an issue I have with permissions, obviously any files made on one pc will be owned by that user and are not writable on another PC. I would like the NFS share to be readable and writable by all computers, I want to make it so that all new files created on the NFS share (no matter which user made them) are writable by any other user on any other computer on the network, there is no internet access so security can be relatively lapse. Can this be done by the NFS setup itself or by basic file permission setups.

    What are my options?
    The best I can figure out on my own are to either set a cron script that runs often that runs chmod 777 recursively on the share directory (obviously this is not a good option) or to use a FAT formatted USB for the share directory so that permissions do not apply (I don't even know if that's possible but it's a thought). I hoping people who know more about this subject have more practical and insightful ideas.

    Some things to know:
    I am not the sysadmin but I do have root access
    The owner of the PC's (the director) is quite happy for me to do this but the IT people are not willing to help, although quite happy to look the other way
    PC hostnames and usernames cannot be changed
    No internet access
    The PC's are not very up to date (running 10.04 I think)


    Thanks for any help provided
    Regards
    Mark
    Catch me on Freenode - imark

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,458
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Make NFS share universally writable

    Probably the easiest solution is to put all the users into a group in /etc/group, then give the group ownership of the directory and set the permissions to 2775. The "2" sets the sgid bit so that files created by any user inherit the group's ownership. With the default Ubuntu umask of 0002, files should be readable and writable by any of the group's members.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    May 2009
    Location
    Fareham, UK
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Make NFS share universally writable

    This is the sort of answer I was hoping for. I am back at work tomorrow so I will give this a try and report back. Thanks.
    Catch me on Freenode - imark

  4. #4
    Join Date
    May 2009
    Location
    Fareham, UK
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Make NFS share universally writable

    That suggestion done the trick mostly (so thanks) except some clients but not all seem to be overriding the file permissions from gnome only. On the problem clients (about half of them) and file created from the command line works fine however any file created from gnome/nautilus is created with 700 permissions. Any suggestions to work around this, failing that I'm back to the idea of a FAT formatted usb for the share.

    I've checked in .profile .bash_profile for any lines that change the umask but found nothing

    PS. This is Gnome 2 from the good ol' days
    Catch me on Freenode - imark

  5. #5
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,458
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Make NFS share universally writable

    A quick Google search for "nautilus umask" brings up a raft of posts about how Nautilus seems to ignore the umask set in .profile. One suggestion was to create a .bash_profile, which Ubuntu does not typically use, and put the umask command there. However the range of queries and comments left me confused as to what the correct approach should be.

    Since I'm a KDE user I'm afraid that's all the help I can give with this problem.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  6. #6
    Join Date
    May 2009
    Location
    Fareham, UK
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Make NFS share universally writable

    Well thanks for the assist figuring out the problem, I got tunnel visioned onto gnome when it is just literally only files made via a nautilus right click menu that have the permissions issue. Seen as no one is likely to be doing that here I'm not going to consider it a problem.

    Many thanks
    Catch me on Freenode - imark

  7. #7
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,458
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Make NFS share universally writable

    Glad I can help. You should mark this [SOLVED] using the "Thread Tools" drop-down at the top of the page.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  8. #8
    Join Date
    Oct 2008
    Location
    Ottawa, Canada
    Beans
    809
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: Make NFS share universally writable

    For the record, the "official" way of granting full access to an NFS share is with the following setup (which bypasses file permission issues):
    In your /etc/exports file (on the server), your share should contain the all_squash parameter. This will make all guests appear as the anonymous user. You can then elevate the anonymous user to the UID of any server user, with parameters anonuid=<uid> and anongid=<gid>
    That way, anyone connecting to the share will appear as the same server user, no matter who they are, and will have shared ownership of everything. If you don't have one, you should create a user on the server (e.g., nfsuser) for that purpose, and chown all files in the share to match.
    Cheers!
    husband@wife$ make sandwich
    Permission denied
    husband@wife$ sudo make sandwich

  9. #9
    Join Date
    May 2009
    Location
    Fareham, UK
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Make NFS share universally writable

    This is definitely good to know, Thanks.
    Catch me on Freenode - imark

  10. #10
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,458
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Make NFS share universally writable

    That way, anyone connecting to the share will appear as the same server user, no matter who they are, and will have shared ownership of everything. If you don't have one, you should create a user on the server (e.g., nfsuser) for that purpose, and chown all files in the share to match.
    Like the Samba force user/group directives, that approach will not allow you to audit files by username. If you care about which files little Billy is storing on the server, you need to use a method that allows billy to write files there with his username. If you don't care about tracking ownerships, then the method LewisTM describes will be fine.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Bookmarks

Posting Permissions

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