Questions and screenshots?
When the client mounts the nfs shared directory, the prompt is as follows:
mount.nfs: access denied by server while mounting 192.168.44.10:/xxx
There are two reasons for the problem:
1: Permission issues
The shared directory on the server does not have sufficient permissions, causing the mount to fail.
Solution: Modify the permissions of the shared directory on the server side or directly give 777 permissions to test, and the connection is successful.
Two: The permissions have been given but still cannot be mounted.
Problem description: In fact, the folder permissions are set to 777, and there is no problem with the permissions. Hosts.deny and hosts.allow both retain the default settings. The firewall is also turned off. All the settings are set, but it is still rejected.
First use the command to view the error log file
cat /var/log/messages |grep mount
I googled and found that since the port is over 1024 I needed to add the "insecure" option to the relevant line in /etc/exports on the server. Once I did that (and ran exportfs -r), the mount -a on the client worked.
//If the port number is greater than 1024, you need to add the insecure option to the relevant options in the configuration file (/etc/exports) in order for the mount client to work properly:
Looking at the description of the secure option in the exports manual, we also found that this is indeed the case.
[root@server]# man exports
secure,This option requires that requests originate on an Internet port less than IPPORT_RESERVED (1024). This option is on by default. To turn it off, specify insecure.
// The secure option requires the mount client request source port to be less than 1024 (however, when using NAT network address translation, the port is usually greater than 1024). This option is enabled by default. If you want to disable this option, use the insecure flag .
Modify the configuration file /etc/exports and add the insecure option
Then restart the nfs service: service nfs restart | systemctl restart nfs
--------------------------The problem was successfully solved-------------------- ------