1

In one of my assignments on CentOS 7, I am trying to NFS mount /home directory from management node to client node. I have given the commands I have tried below.

I tried to disable firewall, but it's asking for password which I don't have, and so it didn't work. Then I made changes in the exports file as below, but nothing to my avail. PFB the commands I ran:

[user@node-1 ~]$ ssh -i ~/.ssh/key node-2
Last login: Wed Sep 19 12:56:36 2018 from 192.18.0.3
[user@node-2 ~]$ sudo mount -t nfs 192.18.0.3:/home /home          
mount.nfs: access denied by server while mounting 192.18.0.3:/home
[user@node-2 ~]$ exit
logout
Connection to node-2 closed.
[user@node-1 ~]$ systemctl disable firewalld
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ===
Authentication is required to manage system service or unit files.
Authenticating as: Cloud User (user)
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Failed to execute operation: Access denied
[user@node-1 ~]$ sudo vi /etc/exports

The changes made in the exports file are as:

/home 192.18.0.*(rw,sync,no_root_squash,no_all_squash)

And then I tried updating the changes but got another error

[user@node-1 ~]$ exportfs -ra
exportfs: could not open /var/lib/nfs/.etab.lock for locking: errno 13 
(Permission denied)
exportfs: can't lock /var/lib/nfs/etab for writing

Can anyone help me mount the /home directory from the management server to client server, please?

2

2 Answers 2

2

192.18.0.* is not a valid ip or subnet. Try 192.18.0.0/24 instead.

  • Note: the 192.18.0.0 - 192.18.194.255 ip range belongs to Oracle Corporation. Don't use it unless you're a worker at oracle.
2
  • calvin probably did not type the subnet correctly. I guess, it was meant to be 192.168.0.0/24.
    – Hermann
    Sep 20, 2018 at 7:43
  • Last login: Wed Sep 19 12:56:36 2018 from 192.18.0.3 so it probably really is this subnet. Sep 21, 2018 at 6:52
0

To check what are the allowed IP networks run this command in node-1:

$ showmount -e localhost

or this in node-2

$ showmount -e node-1

You should see the IP networks actually allowed to mount each of the NFS exported directories in node-1.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .