[root@localhost ~]# cat /etc/exports
/home *(rw,sync,no_subtree_check,no_root_squash)
/var/www/svn *(rw,sync,no_subtree_check,no_root_squash)
/home
If you want to use as a mount point on the NFS client , and /home
create a subdirectory named under the directory , it is very important home
to ensure that you have sufficient permissions to create subdirectories under the directory./home
The problem may be that the permissions are being overridden when the NFS filesystem is mounted. To resolve permissions issues on NFS clients, you can try using the option when mounting NFS filesystems no_root_squash
. no_root_squash
option ensures that when using the root user (with UID 0) on the NFS client, its permissions are not mapped to an unprivileged user on the remote NFS server. This ensures that the root user has the same permissions on the client as on the server, including /home
creating subdirectories under the directory.
/etc/fstab
For example, suppose you have the following mount configuration in your file:
172.16.3.67:/remote_home /home nfs defaults 0 0
You can modify it to:
172.16.3.67:/remote_home /home nfs defaults,no_root_squash 0 0
Then remount:
sudo mount -o remount /home
By adding the option, you should be able to create subdirectories under the directory no_root_squash
on NFS clients without running into permission issues./home
home
But please note that enabling no_root_squash
will make the root user have the same permissions on the NFS client as on the server, which may bring some security risks. In practical applications, please carefully balance security and convenience, and make sure to select the appropriate permission configuration according to your environment.