| server #安装nfs* [root@server ~]# yum -y install nfs-utils #开机自启动nfs* [root@server ~]# systemctl enable nfs-server #启动nfs [root@server ~]# systemctl start nfs-server #查看nfs是否启动(相同) [root@server ~]# systemctl status nfs-server [root@server ~]# systemctl is-active nfs-server #创建文件share和privacy [root@server ~]# mkdir /share [root@server ~]# mkdir /privacy #输入参数 [root@server ~]# vim /etc/exports #参数 /share 192.168.1.0/24(ro) /privacy 192.168.1.20/24(rw,sync) #重新加载 [root@server ~]# exportfs -r #重新输出 [root@server ~]# exportfs -v #给share和privacy添加文件 [root@server ~]# echo "hello,world"> /share/text [root@server ~]# echo "hello,evryone"> /privacy/txt #查看共享的文件 [root@server ~]# showmount -e 192.168.1.10 #添加读写执行权限 [root@server ~]# chmod 755 /share [root@server ~]# chmod 777 /privacy #查看读写执行权限的参数 [root@server ~]# ll -d /share [root@server ~]# ll -d /privacy | client #安装nfs* [root@server ~]# yum -y install nfs-utils #开机自启动nfs* [root@server ~]# systemctl enable nfs-server #启动nfs [root@server ~]# systemctl start nfs-server #查看nfs是否启动(相同) [root@server ~]# systemctl status nfs-server [root@server ~]# systemctl is-active nfs-server #到mnt目录 [root@client zard]# cd /mnt #查看文件 [root@client mnt]# ls #创建文件(cd /mnt/) [root@client mnt]# mkdir share [root@client mnt]# mkdir privacy #挂载 [root@client mnt]# mount -t nfs 192.168.1.10:/share /mnt/share [root@client ~]# mount -t nfs 192.168.1.10:/privacy /mnt/privacy #挂载只读 [root@client mnt]# mount -t nfs -o -ro192.168.1.10:/share /mnt/share [root@client mnt]# mount #取消挂载 [root@client mnt]# umount /mnt/share
#privacy 读写验证 [root@client ~]# cd /mnt/privacy [root@client privacy]# touch aaa #share 只读验证 [root@client ~]# cd /mnt/share [root@localhost share]# ls text [root@localhost share]# touch jpeg #查看挂载 [root@client privacy]# ll [root@client ~]# showmount 192.168.1.10 -e | ||||



