How to make an NFS export always read-write for all users?

Posted on 2005-04-15
Last Modified: 2011-09-20
Here's the situation:

We have a directory on our Linux server that we use to share files among our employees.  Let's call this /home/shared for example.  We share this directory via samba and NFS so that all our Windows, Mac, and Linux users may access it equally.

A problem we are running into is that our Mac-using webmaster will put a file in there via NFS, but the permissions are set such that the Windows-using webmaster cannot open the file.  How do we set up our exports file so that ALL files created in that directory are set with read-write permissions for all?

Here are excerpts from our current smb.conf and /etc/exports:

<smb snip>
        comment = Server Shared Files
        path = /home/shared
        writeable = yes
        browsable = yes
        public = yes
        create mode = 0777
        directory mode = 0777
        guest ok = yes
        guest account = nobody

this is /etc/exports:

/home/shared   ,insecure,sync)
/home          ,root_squash,async)
Question by:sudama
    LVL 19

    Expert Comment

    did you check permissions on the file the Mac-user webmaster stored using NFS?

    you should grant rights for the group to write, and maybe add this also:

    chgroup nogroup /home/shared
    chmod g+s /home/shared
    LVL 51

    Expert Comment

    beside chmod g+s , what umask does your Mac use?
    LVL 38

    Expert Comment

    > put a file in there via NFS, but the permissions are set such that the Windows-using webmaster cannot open the file.
    umask 000
    in /etc/bashrc and /etc/csh.cshrc (system-wide) or in your .bashrc (.profile, .login, or .cshrc)

    So the file create in Mac will be readable/writeabke for everyone.
    LVL 19

    Expert Comment

    I would instead check the umask for the user, since changing it system-wide would probably affect many other programs...
    LVL 51

    Expert Comment

    so we wait for the answer to http:#13802136 ;-)

    Author Comment

    Maybe I was not being clear.

    Files created by the Mac user in the NFS share on my Linux server are set at permissions of 644, with username adoss and groupname adoss.  

    I want the files that she creates in the nfs share to be read-write for all.

    We don't want all the files she creates on her own computer to be read-write for all.  

    How exactly is this accomplished?
    LVL 38

    Accepted Solution

    So far NFS doesn't have this feature to do it automatically. In other words, no.
    NFS to Unix/Linux OS is like local filesystem.
    So the umask setting is applying to local filesystem as well as NFS mount directories.

    Whatever you set in smb.conf is for the files create from Windows machine through SAMBA.
    So it won't affect the files you create from/in Linux even though those files are on SAMBA shared directories.

    You need to setup cron job to do
    find /path-to-NFS-share -type f -user adoss -exec chmod a+rw {} \;
    periodically (i.e. every 10 minutes)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now