NAS NFS Share: Applying No_Root_Squash and Anonymous uid/gid=0 Settings

OVERVIEW

The no_root_squash setting allows NFS (Network File System) clients to connect to the share as root. This topic provides instructions on how to apply the no_root_squash setting and change the anonymous uid/gid=0 settings to grant permission to NFS clients to change permissions of files/directories.

 

SR Information1462992, 1468994 and 1463040

 

Product / Software Version: All DXi platforms with 1.x and 2.x software.

 

Problem Description: The customer has a DXi system running (version 2.1.3) and needs to apply the no_root_squash setting so NFS (Network File System) clients can connect to their shares as root. The customer also wants to change the anonymous uid/gid=0 settings on the shar to grant permission to NFS clients to change permissions of files/directories.

 

Reference PTRs:

Bug 31103 Link will open in new window.- enhancement request - to add no_root_squash option on gui or cli

Bug 19264 Link will open in new window.- Do not use old school method (change /etc/export). All manual changes on /etc/export can be lost. See comment#0: " Aknowledgeable can add this option to /etc/exports file, buth the option will be gone as a new share is added or an old share is deleted".

 

This topic provide instructions on the following:

 


Applying No_Root_Squash

Applying the no_root_squash setting does not allow NFS clients to change file/directory permissions. If you want to also grant permission to the NFS clients to change permissions of the files/directories on the NAS share, you need to change the anonymous uid/gid=0 settings, which is described below.

 

To apply no_root_squash to a share:

 

  1. Advise the customer that this setting may not migrate over after a system upgrade.

     

  2. Make sure NAS is not in use when applying this setting.

     

  3. Log in to the DXi using putty (root user) and execute the following command:

     

    sharetool --edit share --name <name_of_nfs_nas_share> --squash none

     

  4. In order to verify that the changes were successfully applied, run a cat (or less) command on the file: /etc/exports

Example:

 

Suppose you want to apply this change to the NFS NAS share named "test-nfs." You can see the following line in the file: /etc/exports:

 

/Q/shares/test-nfs *(sync,rw,root_squash,anonuid=4294967294,anongid=4294967294,no_subtree_check,anonuid=4294967294,anongid=4294967294,fsid=18850)

 

The command to be executed is:

 

sharetool --edit share --name test-nfs --squash none

 

After the no_root_squash setting is applied, you will see the following in /etc/exports:
 

/Q/shares/test-nfs *(sync,rw,no_root_squash,anonuid=4294967294,anongid=4294967294,no_subtree_check,anonuid=4294967294,anongid=4294967294,fsid=18850)

 

 


Applying Anonymous uid/gid=0

The anonymous uid/gid=0 settings allow NFS clients to inherit the root uid and gid and allow you to change the permissions, owner, and group of the files/directories in the NAS share. These settings should only be applied if requested by the customer.

 

 Note: In a regular Linux environment, the settings above are applied by changing the exports file manually followed by the command 'exportfs -ra'. Unfortunately it was found on DXi system with 2.1.x software that this command may work but when a customer applies any change (even minor changes such as delete/add/change description of a NAS share) to any NFS NAS shares using the DXi GUI, the settings you applied manually on /etc/export with exportfs will be lost. The settings return to the default configuration. which is root_squash and anonuid/anongid = 4294967294. With that in mind, it is recommended to use the sharetool command, as described in the procedure below.

 

To apply Anonymous uid/gid=0 settings to a share:

 

  1. Advise the customer that this setting may not migrate over after a system upgrade.

     

  2. Make sure NAS is not in use when applying this setting.

     

  3. Log in to the DXi system using putty (root user) and execute the following command:

     

    Note: This command also applies no_root_squash.

     

    sharetool --edit share --name <name_of_nfs_nas_share> --squash none --anonuid 0 --anongid 0

  1. In order to verify that the changes were successfully applied, run a cat (or less) command on the file: /etc/exports

Example:

 

Suppose you want to apply the change to a NFS NAS share named "test-nfs." You can see the following line in the file: /etc/exports: 

 

/Q/shares/test-nfs *(sync,rw,root_squash,anonuid=4294967294,anongid=4294967294,no_subtree_check,anonuid=4294967294,anongid=4294967294,fsid=18850)

 

The command to be executed is:

 

sharetool --edit share --name test-nfs --squash none --anonuid 0 --anongid 0

 

After the setting is applied, you will see the following in /etc/exports:

 

/Q/shares/test-nfs *(sync,rw,no_root_squash,anonuid=0,anongid=0,no_subtree_check,anonuid=4294967294,anongid=4294967294,fsid=18850)

 

 


 



This page was generated by the BrainKeeper Enterprise Wiki, © 2018