# nfs: nobody as user and group

## jody

Hi

I have a nfs server (on a fedora machine named plankton) which exports its directory /mnt/data1 to the gentoo machine 'cari' (IP address: xxx.xxx.xxx.yyy): 

```

[jody@plankton ~]$ cat /etc/exports

# /etc/exports: NFS file systems being exported.  See exports(5).

/mnt/data1 xxx.xxx.xxx.yyy(rw,async)  xxx.xxx.xxx.zzz(rw,async) xxx.xxx.xxx.www(rw,asynv)
```

The machine cari is also listed in plankton's /etc/hosts.allow for lockd, portmap,mountd,statd and rquotad

On cari the fstab entry for this mount is

```
plankton:/mnt/data1  /mnt/data1       nfs             rw,hard,intr,nosuid,rsize=8192,wsize=32768,timeo=30    0 0
```

I made sure that my user id (1010) and my main group "morpho" (500) are the same on client and server.

When i mount plankton's file system on cari, i can change into all directories and have read access.

But when i create  a file on /mnt/data1, it has user and group 'nobody':

```
jody@cari ~ $ whoami

jody

jody@cari ~ $ groups

wheel audio video morpho

jody@cari ~ $ cd /mnt/data1

jody@cari /mnt/data1 $ touch test.txt

jody@cari /mnt/data1 $ ls -l test.txt

-rw-r--r-- 1 nobody nobody 0 Apr 22 09:51 test.txt

```

(on  plankton a listing of this file gives 'nfsnobody' for both user and group, but this may be a fedora thing)

This a problem when i want to modify a file in a directory owned by 'jody' and group 'morpho' with permissions 644.

I have various other gentoo machines which have nfs access to plankton and whose userid and group are 

correctly set to 'jody' and 'morpho' when i create a file on this mounted file system.

On these machines i also have the same line in fstab as on cari.

cari's info:

```
Linux aim-cari 2.6.18-gentoo-r6 #2 SMP Wed Jan 10 11:07:34 CET 2007 i686 Intel(R) Xeon(TM) CPU 2.80GHz GenuineIntel GNU/Linux
```

cari's make.conf:

```
# These settings were set by the catalyst build script that automatically built this stage

# Please consult /etc/make.conf.example for a more detailed example

CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CXXFLAGS="${CFLAGS}"

MAKEOPTS="-j2"

USE="-arts -gnome -kde -svga apache2 mysql pam png ssl xml xml2 X"

GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://gd.tuwien.ac.at/opsys/linux/gentoo/ ftp://ftp.easynet.nl/mirror/gentoo/"

```

I have just synced  and emerged world this morning. 

Can anybody help me out with this?

Thank You

  Jody

----------

## M

Hi,

do you have /etc/init.d/rpc.idmapd started? If not try to start it and then try. Is this nfs4 or 3? I also had some troubles, I mount portage and distfiles over nfs, I also changed uids and gids to be the same on server and client but only rpc.idmapd helped.

----------

## jody

Hi M

rpc.idmapd had not been started on the client so i started it and 

added it with rc-update (i even rebooted th machine).

On the server (fedora) there is a script running which is called 'rpcidmapd' - 

i guess that is the same thing.

However, the problem i still unsolved - 

i still get the nobody user and nobody groups for files i create in the mounted file system   :Sad: 

How do i find out what nfs version i am using?

My net-fs/nfs-utils on the client are version 1.1.4-r1 (but i don't know if this is relevant)

jody

----------

## krinn

 *jody wrote:*   

> How do i find out what nfs version i am using?

 

rpcinfo -p servername will show you all nfs version the server can handle.

 *jody wrote:*   

> 
> 
> ```
> [jody@plankton ~]$ cat /etc/exports
> 
> ...

 

Gave yourself the anwser, it's an invalid exports for nfsv4 so you're running v3 for sure.

 *Quote:*   

> rpc.idmapd had not been started on the client so i started it and
> 
> added it with rc-update However, the problem i still unsolved - 
> 
> 

 

 *Quote:*   

> The machine cari is also listed in plankton's /etc/hosts.allow for lockd, portmap,mountd,statd and rquotad

 

and now need idmapd too  :Very Happy: 

----------

## jody

Thank you for your suggestions.

I added a "idmapd" line to the nfs-server's hosts.allow and restarted its nfs.  

But it still doesn't work (still get 'nobody' user and group), even after 

unmounting and remounting, or rebooting the machine.

What i still don't understand is that other gentoo machines can happpily use 

the nfs (even without idmapd) and get correct user and group ownerships.

Do you have any other idea what could be wrong?

Thank you

  jody

----------

## depontius

Did you set up /etc/idmapd.conf on both client and server?  This file does several things, but I think the key one for here & now is to set the domain on both - matched.  This piece of configuration came later than just nfsv4 capability, so after some nfs-utils update ids quit mapping properly until I found and fixed it.

----------

## krinn

maybe typo in exports, last entry got synv instead of sync. and btw if you are hidding internet ip it's ok, but if you are just hidding local network ip (10. 169 or 192) that doesn't make sens.

and on typo error, the server could just remap clients to anonuser.

----------

## jody

Hi

 *Quote:*   

> if you are hidding internet ip it's ok

 

I don't exactly know what you mean. In have changed the numeric IP address

in my post by "xxx.xxx.xxx.yyy" etc to hide the true numbers but to show they 

are all in the same subnet.

The "asynv" was a typo i made writing the post - i have about 10 IP-adresses

in the export file so i weeded it out by hand (and apparently made that typo then)

to make it more readable.

I checked the exports file again - for my problem machine the entry contains no

typo.

And still, there are 9 other machines that do not have this problem...

----------

