在linux下,搭建NFS服务器

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    //查看状态

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值