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?