Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am able to mount an NFS directory as a regular user (which doesn't have sudo rights) because a suitable entry (i.e. with the user option) is defined in /etc/fstab file.

But, when I mount it, I am not the owner of it! The owner is the default superuser of the system. So I don't have write permissions in the mounted directory.

How can I make the directory mine?

share|improve this question
    
And no "chown" does not work. –  EmreA Nov 8 '10 at 21:40

1 Answer 1

up vote 3 down vote accepted

When using NFS you need to make sure there is UID/GID matching between users, the following artcile might be useful.

share|improve this answer
    
I get the following error when I follow that article: exportfs: /etc/exports:6: unknown keyword "map_static=/etc/nfs.map" But in manpages.ubuntu.com/manpages/lucid/man5/exports.5.html I found anonuid and anongid options. I couldn't make them work though. –  EmreA Nov 8 '10 at 22:09
    
The article mentions you need userspace nfs, you need to use NFS (from the package unfs3), instead of the traditional kernel nfs . –  João Pinto Nov 8 '10 at 22:13
    
When I wanted to install unfs3, it asked me to remove the nfs packages. I am not willing to replace my working nfs server with something I know nothing about. I will look for a solution with my current nfs server. thanks. –  EmreA Nov 8 '10 at 22:44
1  
Another option is to use NFSv4 user id mapping, check help.ubuntu.com/community/NFSv4Howto, please note that on the legacy NFS you don't have any uid mapping options, you need to manually ensure that users have the same uid on both systems. Also you can simply switch nfs packages safely, your configuration will not be removed. –  João Pinto Nov 8 '10 at 23:42
    
I followed the article and used unfs3 but the uid mapping doesn't seem to work. I get no errors but the owner of the mounted directory on the client is still the superuser. Configuring NFSv4 looks very complicated. Thanks for your help. –  EmreA Nov 9 '10 at 1:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.