ubuntu16.04 NFS系统挂载

一:服务器端

step1:关闭防火墙服务器

sudo ufw disable 

step2:安装nfsrest

sudo apt-get install nfs-kernel-server

step3:server

打开/etc/exports文件,在末尾加入:/home/daysmark/nfsdir*(rw,sync,no_root_squash)blog

注:nfs容许挂载的目录及权限,在文件/etc/exports中进行定义,各字段含义以下:get

/home/daysmark/nfsdir:要共享的目录同步

*:容许全部的网段访问it

rw:读写权限class

sync:资料同步写入内在和硬盘cli

no_root_squash:nfs客户端共享目录使用者权限服务器端

重启服务:

#sudo /etc/init.d/nfs-kernel-server restart      //重启nfs服务
#showmount -e                                            //显示共享出的目录

 

二:客户端

nfsclient端安装和配置

(1)安装nfsclient

sudo apt-get install nfs-common

 

(2)查看nfsserver上共享的目录

 

#sudo mount -t nfs 192.168.0.149: /home/daysmark/nfsdir /mnt

 

192.168.0.149为服务器端IP地址这样就把共享目录挂到了/mnt目录

取消挂载用这个指令:#sudo umount /mnt