 |
 |
mount NFS shares on Linux: uid and gid mystery
|
 |
|
 |
|
Senior User
Join Date: Nov 2002
Location: US
Status:
Offline
|
|
I've been trying to figure this out: say on the Linux part I have this in my /etc/exports:
/home/foo my_powerbook(rw,all_squash,anonuid=501,
anongid=20,insecure)
and /home/foo has uid and gid:
uid: 500 (foo)
gid: 500 (foo) (it's a RedHat box)
and the permissions are -rw------- (or drwx------ for directories) all the way down.
Now on my PowerBook say the uid and gid are:
uid: 501 (foo)
gid: 20 (staff)
The /etc/exports listed above didn't work: I can't even peek inside the NFS share using root account. If I change that line into:
/home/foo my_powerbook(rw,all_squash,anonuid=500,
anongid=500,insecure)
I still can't see into the share using foo account on my PB, but I can cd into the share and see all stuff via root.
So I'm utterly confused now: I thought all_squash is to make all NFS shares be owned by anonuid and anongid, thus anonuid=501 and anongid=20 should've worked? (so I get the permission to see/change the stuff on my PB)
Any hint is EXTREMELY welcome!
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Nov 2002
Location: Ottawa, Canada
Status:
Offline
|
|
The easiest thing is to have the same UID/GID on both Linux & OS X. Not too hard to do. That's what I did. The thing that ticks me off is that I have to restart Finder after I log in because all files on the share are zero bytes in length (and zero free space) until then.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2001
Location: Earth
Status:
Offline
|
|
How did you mount the disk?
If I remember corrrectly, you must have opts set with 'net' and '-P'. vsfstype should be nfs.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2002
Location: US
Status:
Offline
|
|
I simply use cmd-k in Finder to mount the share. It's okay since on Linux I used 'insecure' option - I've done this successfully to other NFS shares on the Linux server (the difference though is that those shares all have world-wide readability so the exact uid and gid on OS X side doesn't matter).
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2002
Location: US
Status:
Offline
|
|
to thebunny: yup I thought about that too, but there got to be some more elegant way for this (translating uid and gid on the fly, but without requiring a full NIS running). And I'm sort of afraid that changing uid and gid to some non-standard #s would affect the forward compatibility (correct me if I'm wrong).
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Nov 2002
Location: Ottawa, Canada
Status:
Offline
|
|
OK, I was a bit tired yesterday and still am but I see two problems with your setup.
1.) /etc/exports on the RH box should definitely have anonuid=500, anongid=500. Those are the UID & GID remote requests are mapped to on the RH box (UID 501 might not even exist on your RH box and even if it does it has no access rights in /home/foo). You got that one already.
2.) You should do this on your directories:
chmod u+x /home/foo
/home/foo should look like this:
drwx------ 42 foo foo
Having the executable flag set on a directory means you can 'cd' into it (in geeky language: traverse it) - for a file it means you can execute it.
Sorry for not taking a closer look yesterday...
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2002
Location: US
Status:
Offline
|
|
Thanks thebunny - although it still didn't work. I changed /etc/exports on Linux side as you said, did a "service nfs restart", and actually /home/foo already has the right permission (drwx------). Tried to connect to the share - same: under foo on PowerBook I couldn't even peek into the share, but if I were the root, everything is fine.
I guess the problem is this: having anonuid and anongid as 500 in /etc/exports certainly allows my access on Linux side. But exactly because the share is 500.500, I can't access it on the Mac side (on Mac foo is 501.20).
How am I supposed to solve this dillema? But thanks anyway.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Nov 2002
Location: Ottawa, Canada
Status:
Offline
|
|
LOL, true, both sides have to have the permission. Well this is what I did: I fired up the Netinfo, changed my UID (foo) to 500 (left the GID 20 and created a GID 20 on RH, added myself to GID 20 on RH). Then just run chown -R foo.staff /Users/foo. Logged out, logged back in and it was fine. I had the same user/group/UID/GID on RH & OS X. Problem solved. I always mount NFS as root from a startup script on OS X.
Good luck!
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status:
Offline
|
|
Originally posted by thebunny:
I always mount NFS as root from a startup script on OS X.
Good luck!
Why not just put it in NetInfo so it happens automatically?
Here is what I have:
/mounts/deuce:/home/photos
vstyp nfs
opts (-s, -b)
name deuce:/home/photos
dir /Network/Pictures
This way, my photo share on my Linux box (deuce) is mounted by my wifes and my computer at boot.
|
|
signatures are a waste of bandwidth
especially ones with political tripe in them.
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|