On 2008-01-10, bmearns <(E-Mail Removed)> wrote:
> I know there's a lot of discussions out there about usernames with
> NFS, but I'm having a mental block trying to understand what's going
> on. I want to mount NFS shares between two linux systems. I've got the
> shares working fine, and I'm able to connect with mount -t nfs, but
> when I create files in the share on the client computer, the owner is
> something like nfsuser or something.
Your numeric ids likely don't match.
> I'd like to be able to specify the username when I mount the share. Is
> this possible? I've found a lot of references to username mapping for
> NFS, but everything I've found seems to be between linux and windows
> or linux and mac.
I don't know what references you've found; perhaps you should show some
of them. It's not possible to specify a user when you mount NFS,
because NFS assumes that the numeric UID the client presents is the
numeric UID that the server should use. If that uid doesn't exist, it
will go to nfsuser.
What you need to do is look at the /etc/passwd files and make sure that
any user which will be writing from an NFS client to the server has the
same numeric UID on all systems. If they don't, then you will need to
change the numeric UID so that they're all the same. You'll need to do
this both in /etc/passwd and for any files owned by the old numeric UID.
(There was a thread about how to change a user's numeric UID in one of
the linux newsgroups a few weeks back.)
It's important to stress that NFS itself only deals with the numeric
UID. So, if on the NFS server you have
nobody:x:99:99:Nobody:/:/sbin/nologin
and on a client you have
myuser:x:99:99:Me:/:/sbin/nologin
then a file on the server
-rwxr-xr-x 1 nobody whatever 6188 Nov 13 2006 myFile
will look like
-rwxr-xr-x 1 myuser whatever 6188 Nov 13 2006 myFile
on the client. NFS never passes the name around.
--keith
--
kkeller-(E-Mail Removed)
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information