Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a username on an ubuntu server, lets call it user a. I want to mount a directory from that server to my Mac, on which I have another username, lets call it user b. My problem is that, after I mount the directory (using the disk utility app) I can view files on the server but can't modify or create new files on it.

I checked, and if I change the permissions of the server directory so that its open to everyone (chmod 777), I can write to it. So what I need to know, is how can I specify the username and password in the NFS client when setting up the mount? That is, I want to specify that I'm trying to log in as user a to the server.

share|improve this question

3 Answers 3

@Yair - It sounds like you could just add a user on the Linux side to match the Mac side down to the matching UID. Then give that user rights to the directory. NFS doesn't sound wrong at all in this case, just that you have a little more work to set it up the way you want.

share|improve this answer
    
Any suggestions on what to do if a different user already exists on the server with the same UID as the user on the client machine? Is it possible to change UIDs for a user once they've been set or am I out of luck? –  Matt Passell Jul 15 at 15:22
    
Changing the UID is possible, but "how" depends on which system you are changing it on and the back-end where the user lives (if applicable.) Think through all ramifications of changing that user's UID. Home directory ownership and all files owned by that user will be impacted. Start up a new question if you run into problems with this. –  Aaron Copley Jul 15 at 15:51
    
Yeah. Sounds like I'd stumble over too many unintended consequences. Fortunately, it's over a LAN and not very sensitive stuff, so I'll probably go with the chmod 777 approach. –  Matt Passell Jul 18 at 19:47
up vote 1 down vote accepted

Ok. As Aaron suggested, I created a user on the Linux side, with the same username and UID as the one on the Mac. Seems to do the trick!

share|improve this answer
    
If Aaron's answer was correct, you should have accepted it, rather than entering your own answer and accepting that. –  Matt Passell Jul 15 at 18:05

NFS doesn't work that way; you don't specify any particular user when you connect, instead the server trusts the client computer to tell it who's actually doing the file access. It does this by user ID number, so if you're logged in as user #501 on the client, the server will give you whatever user #501 (if it exists) would have on the server. This is great when both computers are set up with a common user database (e.g. a network directory domain), so the user IDs match up between them; if the computers don't share the same user database, it doesn't work at all.

Basically, NFS is the wrong protocol for what you're trying to do.

share|improve this answer
    
Thanks for you reply. So what would you suggest I do? I have this server in which I have one username, and I need to mount a directory from it to my office machine. I can probably create a new user on the server with the same name, but they won't be managed by the same domain. If NFS is the wrong protocol, what would be the right one? Thanks –  Yair Nov 22 '10 at 15:12
2  
@Yair - It sounds like you could just add a user on the Linux side to match the Mac side down to the matching UID. Then give that user rights to the directory. NFS doesn't sound wrong at all in this case, just that you have a little more work to set it up the way you want. –  Aaron Copley Nov 22 '10 at 15:50

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.