centos7服务器 IP:7.7.7.7
kali客户机 IP:7.7.7.9
第一步:关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
第二步:禁用selinux
vim /etc/selinux/config
将enforcing改为disable
第三步:下载安装包
yum -y install nfs-utils
yum -y install rpcbind
第四步:服务器配置
启动nfs
#sudo service rpcbind start //启动rpcbind
#sudo service nfs-server start //启动nfs-server
#sudo chkconfig rpcbind on //设置开机启动nfs
#sudo chkconfig nfs-server on //设置开机启动
配置/etc/exports
vim /etc/exports
/share 7.7.7.9(rw,sync) //按Esc退出编辑模式,':wq!'保存退出
第五步:客户机配置
创建挂载点
#mkdir /mnt/clientshare //显示共享内容的目录
#mount 7.7.7.7:/share /mnt/clientshare //将客户机挂载到nfs
#cd /mnt/clientshare //转到挂载点目录
第六步:测试
在服务器端创建share
mkdir /share
cd /share
touch 1
在客户端查看
ls //显示目录 注意:在/mnt/clientshare里显示目录
df -h //查看挂载
showmount -e localhost //查看共享目录
systemctl status rpc.srevice //查看状态