LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   NFS share permission denied (http://www.linuxquestions.org/questions/linux-networking-3/nfs-share-permission-denied-797347/)

avtandil_k 03-23-2010 02:03 PM

NFS share permission denied
 
Hi,
I'm sure there is a very trivial solution to my problem but I just can't figure it out due to my lack of knowledge.

I want to mount an nfs share share on client1. The share is on server1.
The server1 /etc/exportfs has entry:

/backup client1(rw,all_squash,no_subtree_check)

The client1 sudo mount works just fine:
sudo mount server1:/backup /backup

and obviously the ls -l shows

drwxr-xr-x 2 root root 4096 Mar 23 12:07 backup

But I want a regular user to be able to read/write to that nfs folder. And with the regular user I get

touch: cannot touch `backup/test': Permission denied

Can anyone let me know how to mount the nfs whare with options to read/write permissions for a regular user. And then put that mount into /etc/fstab? Should I mount first and then change the ownership of that folder?

Thanks!!!

rweaver 03-23-2010 02:06 PM

Code:

all_squash
    Map all uids and gids to the anonymous user. Useful for NFS-exported public FTP directories,
    news spool directories, etc. The opposite option is no_all_squash, which is the default setting.

So when you're a user you don't have permissions... if you're the only user accessing it you might want to set the anonuid anongid everything is getting squashed to.

avtandil_k 03-23-2010 02:27 PM

Thanks. I've read somewhere about it. So, if the user1 on client1 has uid 500 and gid 500 the /etc/exports should just have: anonuid=500,anongid=500?

avtandil_k 03-23-2010 03:13 PM

I think I found the solution. Will post it later.

avtandil_k 03-23-2010 03:34 PM

Created a user and a group on the NFS server to match the uid and gid of the user1 on the client1.
changed the ownerwhip of the NFS folder to share with a client1 to the newly created user.
Now it all works. As I though - lack on knowledge and understanding on how the NFS user permissions mapping works made me go through a lot this morning.


All times are GMT -5. The time now is 03:47 PM.