nfs
Installing and Configuring NFS server
1 |
yum install nfs-utils |
Service | Description |
---|---|
nfs-server | Enabled the clients to access NFS server |
rpcbind | Converts RPC program numbers into universal addresses |
nfs-lock / rpc-statd | NFS file locking. Implemented file lock recovery when an NFS server crashes and reboots |
nfs-idmap | Translates user and group ids into names, and vice-versa |
Installing (CentOS 7)
1 2 |
systemctl enable rpcbind systemctl enable nfs-server |
1 2 3 4 |
systemctl start rpcbind systemctl start nfs-server systemctl start rpc-statd systemctl start nfs-idmapd |
Creating NFS Share
1 |
mkdir -p /nfs/export1 |
1 |
vim /etc/exports |
1 |
/nfs/export1 x.x.x.x(rw, sync ,no_root_squash) |
no_root_squash : By default, any file request made by user root on the client machine is treated as by user nobody on the server. (Exactly which UID the request is mapped to depends on the UID of user “nobody” on the server, not the client.) If no_root_squash is selected, then root on the client machine will have the same level of access to the files on the system as root on the server.
Once you have edited the /etc/exports file you will need to push these changes through:
1 |
exportfs -r |
Firewall configuration
1 2 3 4 |
firewall-cmd --permanent --zone public --add-service mountd firewall-cmd --permanent --zone public --add-service rpc-bind firewall-cmd --permanent --zone public --add-service nfs firewall-cmd --reload |
nfs.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1