Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a problem with a embedded Linux device that is mounting its root filesystem over NFS.

But for different reason the embedded device is a single user device running as root (and later it will not even have a network connection).

On the pc I would like that my normal user own all the files, so I can modify them with out being root (or using sudo) all the time.

But right now as soon as the client create a new file on the nfs mount the user id is set to root and I get a problem on the server.

So my question is if there is a flag I can set in the /etc/export solves this problem? So that when the client creates a file, the uid on the server is not root but that of the user (maybe 500 or 1000).

This is my current /etc/export on the server

/opt/eldk/armVFP  *(rw,sync,no_root_squash)
share|improve this question
    
Are you using NFSv3 or NFSv4? –  Caleb Sep 20 '11 at 13:36
    
I think it is NFSv4, the "server" is running Ubuntu 10.04LTS desktop. –  Johan Sep 20 '11 at 13:49

1 Answer 1

up vote 1 down vote accepted

The easiest way to get around it is to set the permissions of the share on the server to be world writable (0777). The on the client (your embedded device) set the user's umask to 0000. Also remove the no_root_squash option. You want root_squash on. This turn root into the nobody user. You can then read and write any file created on the share as any user on the server system.

WARNING
What I have described is an extremely insecure configuration, so I highly discourage doing this for anything other than a closed, private network.

share|improve this answer
    
It kind of works for some parts, but in a root filesystem other parts need to be root so I have to split my mount into a couple of smaller mountpoints. –  Johan Sep 21 '11 at 6:54

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.