[PLUG] NFS Permission Q

Russell Evans russell-evans at uswest.net
Wed Mar 12 14:42:01 UTC 2003


On 12 Mar 2003 12:08:43 -0800, Derek Loree said:

> On Wed, 2003-03-12 at 11:29, Kyle Accardi wrote:
>  > Okay, it's been awhile and I can't find the answer in the places I've looked 
>  > (duh).
>  > 
>  > Problem is that a directory mounted via fstab (or manually by root) gets a 
>  > uid/gid that doesn't otherwise exist on the client.  Therefore, no one has 
>  > access.
>  > 
>  > Added no_root_squash to prove that my method is otherwise working.  And root 
>  > can now `ls`, but this is to be for user home dirs.
>  > 
>  > I understand, that ideally, the user (let's call him `test`) should have the 
>  > same uid/gid on both machines, but I don't want to do this.  I also don't 
>  > want him squashed to anonymous.  Is this a job for NIS? or is there an 
>  > easier way?  (Maybe NIS is easy...)
>  > 
>  > (From what I gather, automount wouldn't help this problem)
>  
>  Sounds like you need to run the network mounts through SAMBA.  It is
>  very easy to munge uid/gid for each "shared" resource.

If we are going to propose different solutions, then here is an odd ball, might
be fun to build, might be useless, solution.

For a reason other than it being fun to try something different,  this a graph
of a comparision of the speeds vs NFS

 http://www.it.uc3m.es/ptb/nbd/img2.gif
"These are old figures now - taken under 2.0.36, as I recall, with a much older
version of NBD than the current one, but they're still useful. The testbed was
a pair of 64MB P200s on a 100BT switched circuit using 3c905 NICs. The best
speed I could get out of raw TCP between them was 58.3Mb/s, tested using
netperf. Of course, the current NFS implementations have improved too."


The hard part would be changing the users on the client if they are already in
use. 

1. Users on the clients need to have the uid start at 2000 instead of the usual
user id 500
Change the default in /etc/login.defs if you're setting up new users and then
create the users
To change already working users, log the user out and keep them out. Change the
user id in /etc/passwd and then chown the users directory, and all under it, to
be owned by the user.  

2. Setup a directory structure on the server for the export
Example;
/export/home/username1 
/export/home/username2
/export/home/username3
..

3. Using enbd;	http://www.it.uc3m.es/ptb/nbd/ on the server, set up the
exports using uid of the users as the ports for the export.
Example;

enbd-server 2000 /export/home/username1
enbd-server 2001 /export/home/username2
enbd-server 2002 /export/home/username3


4. On the client,  using enbd module, you would have a script that would mount
the export. 
Something with the minimum;
#!/bin/sh
MODPATH=/lib/modules/2.4.xx/drivers/block
insmod $MODPATH/enbd.o
PORT=`id -u`
enbd-client your.server:$PORT -n 4 /dev/nda 
mount /dev/nda $HOME

Thank you
Russell




More information about the PLUG mailing list