Getting access denied error while mounting nfs share

I am finding this error while trying to mount nfs share in client side. These are two virtual machine made for testing purpose.

nfs server name-
nfs client name-

In nfs server - [root@server1 ~]# cat /etc/exports
/nfs *,sync,no_root_squash)

In nfs client- [root@client ~]# showmount -e
Export list for
/nfs *

[root@client ~]# mount /mnt
mount.nfs: access denied by server while mounting

Firewall is temporarily disabled in server and client. Selinux has been set to permissive in server and client.

So friends please guide me. Thanks in advance



Are you able to ping to the client server using hostname, ip and hostname should be resolved and also once trey the below command

#mount -t nfs -o nfsvers=3 /mnt/nfs

for troubleshooting use -vv

#mount -t nfs -vvvv /mnt/nfs


  • Try using in “/etc/exports” as


give specific IP of Client Machine in “/etc/exports” it will work


Hi Raghuu

Please find below output . Client is able to ping using hostname. Still same error.

[root@client ~]# mount -t nfs -o nfsvers=3 /mnt/nfs
mount.nfs: access denied by server while mounting
[root@client ~]# mount -t nfs -vvvv /mnt/nfs
mount.nfs: timeout set for Tue Aug 30 17:22:48 2016
mount.nfs: trying text-based options ‘vers=4,addr=,clientaddr=’
mount.nfs: mount(2): Network is unreachable
mount.nfs: Network is unreachable
[root@client ~]# ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=64 time=0.651 ms
64 bytes from ( icmp_seq=2 ttl=64 time=0.779 ms
64 bytes from ( icmp_seq=3 ttl=64 time=0.317 ms
64 bytes from ( icmp_seq=4 ttl=64 time=1.02 ms
^C ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 0.317/0.692/1.021/0.254 ms

But now I am able mount using IP
[root@client ~]# mount -t nfs -o nfsvers=3 /mnt/nfs
[root@client ~]# cd /mnt/nfs
[root@client nfs]# ls
[root@client nfs]#

Could you please explain why I am not able mount using hostname which I am able to ping. Please find /etc/export for reference.

[root@server1 ~]# cat /etc/exports
/nfs *,sync,no_root_squash)
[root@server1 ~]#


once kindly check the hostname and also once share the content of /etc/hosts form both the servers client and server and also once check the SELinux whether it is enabled or disabled

#vim /etc/sysconfig/selinux


and also once check the log messages from client

and also verify that the portmap service is running.

1 Like

Thanks Raghuu
Your solution worked.


I hope you have got a solution to your problem.
though I am a bit late to reply nut would like to add to the solution for the why actually you are not able to mount or ping using hostname .I think you should mention the ip and the hostname in /etc/hosts.For eg:

1 Like