Server主机(192.168.4.1)
]# mkdir /sharedir #创建共享目录
]# chmod 777 /sharedir #配置共享目录权限
]# chmod u+t /sharedir #配置共享目录 t 权限
]# yum -y install rpcbind
]# yum -y install nfs-utils
]# vim /etc/exports
/sharedir *(rw)
]# systemctl start rpcbind
]# systemctl enable rpcbind
]# systemctl restart nfs
]# systemctl enable nfs
Client主机(192.168.4.10)
]# yum -y install nfs-utils
]# showmount -e 192.168.4.1
Export list for 192.168.4.1:
/sharedir *
]# mkdir /sharedir-client
]# vim /etc/fstab
192.168.4.1:/sharedir /sharedir-client nfs defaults 0 0
]# systemctl start nfs
]# systemctl enable nfs
]# systemctl enable remote-fs.target #远程加载服务开机运行