UID/GID mapping of NFS

Status
Not open for further replies.

ses1984

Cadet
Joined
Jul 31, 2014
Messages
6
I have created a user "ses" with UID 1002, primary group "ses" with GID 1003.

I have a dataset, /mnt/zmain/tank with the following permissions/ownership set recursively:

Code:
# ls -al /mnt/zmain | grep tank
drwxrwxr-x  16 ses ses  59 Oct 29 11:40 tank/


I have created an NFS share with the following settings:
  • Comment:
  • Authorized networks:
  • Authorized IP addresses or hosts:
  • All Directories: True
  • Read Only: False
  • Quiet: False
  • Maproot User: nobody
  • Maproot Group: nogroup
  • Mapall User: N/A
  • Mapall Group: N/A
  • Path: /mnt/zmain/tank
I have attempted to mount this share from a linux client that has user "ses" with UID 1000, group "ses" with GID 1000.

I was under the impression that modern versions of NFS will automatically map by user and group name, not numerically.

If I create new a new user and group on the freenas system with UID and GID 1000, and mount the share, then things line up properly on the client.

Do I need to do this all numerically or is there a way to configure freenas to user name mapping? Or am I doing something else wrong?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
in your mount command you can use the uid= and gid= flags to map user correctly. The value you are going to use is the uid and gid of the linux client making the mount. So I think your mount will look like this.

Code:
mount -t nfs -o uid=1000,gid=1000,tcp,rw <freenasServer>:/path/to/export /mnt/freenasMnt
 
Status
Not open for further replies.
Top