Stumped on NFS usernames - Networking

This is a discussion on Stumped on NFS usernames - Networking ; 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 ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Stumped on NFS usernames

  1. Stumped on NFS usernames

    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.

    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.

    Thanks greatly,
    -Brian

  2. Re: Stumped on NFS usernames

    On 2008-01-10, bmearns 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-usenet@wombat.san-francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    see X- headers for PGP signature information


  3. Re: Stumped on NFS usernames

    Great, thanks for the feedback. I guess I'll need to do some more
    reading to find out the nitty-gritty of groups and what not, but I'm
    able to access shares with the correct UID, and it shows up as the
    correct username on both sides.

    Thanks!
    -Brian

  4. Re: Stumped on NFS usernames

    On Jan 10, 10:56 pm, bmearns 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.
    >
    > 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.
    >
    > Thanks greatly,
    > -Brian


    Hi Brian,

    Yes, the thing is that nfs by default use a username called nobody,and
    it is there on the /etc/passwd file.So that's why you are getting up
    this.
    In oder to avoid this you need to use the special permissions like
    sticky bit ( so only the owner can delete up the file) or change up
    the directory permission.

    Thank You

    Melbin Mathew


  5. Re: Stumped on NFS usernames

    Hi,


    > It's important to stress that NFS itself only deals with the numeric
    > UID.


    This changed in NFS4. Here NFS uses username@nfs4-domain and
    groupname@nfs4-domain in transport.
    But the problems of inconsistent name/id mapping remains nearly the same.

    Regards,

    Michael

  6. Re: Stumped on NFS usernames

    On 2008-01-16, Michael Weis wrote:
    >
    >> It's important to stress that NFS itself only deals with the numeric
    >> UID.

    >
    > This changed in NFS4. Here NFS uses username@nfs4-domain and
    > groupname@nfs4-domain in transport.


    Ooh, didn't know that, thanks! From what I can tell, NFSv4 in the linux
    kernel is relatively new, so my hunch is the OP is not using it. But
    it's still good to keep in mind.

    > But the problems of inconsistent name/id mapping remains nearly the same.


    True. At least what I wrote earlier was mostly accurate.

    --keith

    --
    kkeller-usenet@wombat.san-francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    see X- headers for PGP signature information


+ Reply to Thread