0

On a rhel 5 linux server (updated two months ago), two NAS are being mounted with NFS. On these shares, directories belong to two different users, both existing locally on the server.

One of them is correctly mapped by rpcidmapd, but the other share shows nobody:nobody as owner.

With verbose increased, the output log for the good mount (tomcat user):

Jun  1 15:39:19 server_hostname rpc.idmapd[31250]: nfs4_name_to_uid: calling nsswitch->name_to_uid
Jun  1 15:39:19 server_hostname rpc.idmapd[31250]: nss_getpwnam: name 'tomcat@domain.com' domain 'domain.com': resulting localname 'tomcat'
Jun  1 15:39:19 server_hostname rpc.idmapd[31250]: nfs4_name_to_uid: nsswitch->name_to_uid returned 0
Jun  1 15:39:19 server_hostname rpc.idmapd[31250]: nfs4_name_to_uid: final return value is 0
Jun  1 15:39:19 server_hostname rpc.idmapd[31250]: Client 0: (user) name "tomcat@domain.com" -> id "667"
Jun  1 15:39:19 server_hostname rpc.idmapd[31250]: nfs4_name_to_gid: calling nsswitch->name_to_gid
Jun  1 15:39:19 server_hostname rpc.idmapd[31250]: nfs4_name_to_gid: nsswitch->name_to_gid returned 0
Jun  1 15:39:19 server_hostname rpc.idmapd[31250]: nfs4_name_to_gid: final return value is 0
Jun  1 15:39:19 server_hostname rpc.idmapd[31250]: Client 0: (group) name "tomcat@domain.com" -> id "667"

And for the user not being correctly mapped, we've got a -22 exit code :

Jun  1 15:56:31 server_hostname rpc.idmapd[7128]: nfs4_name_to_uid: calling nsswitch->name_to_uid
Jun  1 15:56:31 server_hostname rpc.idmapd[7128]: nss_getpwnam: name '10701' domain 'domain.com': resulting localname '(null)'
Jun  1 15:56:31 server_hostname rpc.idmapd[7128]: nss_getpwnam: name '10701' does not map into domain 'domain.com'
Jun  1 15:56:31 server_hostname rpc.idmapd[7128]: nfs4_name_to_uid: nsswitch->name_to_uid returned -22
Jun  1 15:56:31 server_hostname rpc.idmapd[7128]: nfs4_name_to_uid: final return value is -22
Jun  1 15:56:31 server_hostname rpc.idmapd[7128]: Client 0: (user) name "10701" -> id "99"
Jun  1 15:56:31 server_hostname rpc.idmapd[7128]: nfs4_name_to_gid: calling nsswitch->name_to_gid
Jun  1 15:56:31 server_hostname rpc.idmapd[7128]: nfs4_name_to_gid: nsswitch->name_to_gid returned -22
Jun  1 15:56:31 server_hostname rpc.idmapd[7128]: nfs4_name_to_gid: final return value is -22
Jun  1 15:56:31 server_hostname rpc.idmapd[7128]: Client 0: (group) name "672" -> id "99"

The same mounts work fine on a rhel 7.4 server.

/etc/idmapd.conf is the same on both servers.

Both users and groups exist locally, getent passwd responds fine for both users.

User name is more than 8 characters long, tried to reduce it to 8 but without success.

Thought about the uid that is superior to 10000, but couldn't find a doc talking about that kind of limitations.

Running short of ideas now, I googled a lot but couldn't find the reason why it works on one user but not the other.

  • You say user exist, does it exist with same id ? (the only thing counting to say a user exists on both machine is the id is the same). Does id 10701 return the same user on all machines ? – Tensibai Jun 1 '18 at 15:46
  • but maybe you just hit a bug like this one which may make sense on why rh7 is not impacted where 5 is. – Tensibai Jun 1 '18 at 15:50
  • Hi, yes the uids are the same on both servers, primary group was different but I fixed that without any change in the behaviour. I'm gonna check to see if we hit the bug you suggest. – ShaolinMonk Jun 4 '18 at 7:16
0

NFSv4 comes with a method to map user name to user ids. If you like to have the same credentials on server and client, you may e.g. give both systems the same domainname

If this does not work on your platform, search in the documentation for information on how to configure the nfsv4 domain

  • This usually works fine, the other NAS qtree is correctly mounted, the user is correct. Both mounts comes from the same NAS, we've got hundreds of NAS mounts that work perfectly. – ShaolinMonk Jun 1 '18 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.