Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 4 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/" But in 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
Another option is to use NFSv4 user id mapping, check, 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


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.