linux NFS服务部署

1.nfs服务端部署

[root@nfs-server ~]# yum install nfs-utils rpcbind -y  
[root@nfs-server ~]# vim /etc/exports
/data 192.168.1.10(rw,sync,all_squash)
#/data 192.168.1.0/24(rw,sync,all_squash)

[root@nfs-server ~]# /etc/init.d/rpcbind start
[root@nfs-server ~]# /etc/init.d/nfs start

[root@nfs-server ~]# /etc/init.d/nfs reload        # 重载,不影响nfs客户使用

[root@nfs-server ~]# chkconfig rpcbing on
[root@nfs-server ~]# chkconfig nfs on
[root@nfs-server ~]# chown -R nfsnobody.nfsnoboby /data

[root@client ~]# showmount -e 192.168.1.20  # 检查是否能挂载

2.nfs客户端部署

[root@client ~]# yum install nfs-utils rpcbind -y
[root@client ~]#/etc/init.d/nfs start
[root@client ~]# chkconfig nfs on
[root@client ~]# showmount -e 192.168.1.20
[root@client ~]# vim /etc/rc.local            # 开机自动挂载
mount -t nfs 192.168.1.10:/data /mnt    

 附录:

mount -t nfs -o nosuid,noexec,nodev,noatime,nodiratime 192.168.1.20:/data /mnt   # suid取消,不允许执行,不允许建立设备,不允许改变文件,目录时间戳,

 

posted @ 2017-04-20 11:56  sunmmi  阅读(143)  评论(0)    收藏  举报