在Ubuntu系统中配置NFS
1.部署NFS Server端 1.1安装nfs-kernel-server sudo apt-get install nfs-kernel-server 1.2配置/etc/hosts.deny vi /etc/hosts.deny #在文件中增加内容 ###NFSDAEMONS portmap:ALL lockd:ALL mountd:ALL rquotad:ALL statd:ALL 1.3配置/etc/hosts.allow vi /etc/hosts.allow #在文件中增加内容 ###NFSDAEMONS portmap:客户端IP lockd:客户端IP rquotad:客户端IP mountd:客户端IP statd:客户端IP 1.4重启portmap deamon /etc/init.d/portmap restart 1.5配置/etc/exports 若将192.168.71.205的/home目录共享给192.168.71.46,在/etc/exports文件中添加 /home 192.168.71.46(rw,sync,no_root_squash) 说明: (1)rw是读写权限,只读为ro; (2)sync数据同步写入内存和硬盘,async数据会先暂存在内存,而不立即写入硬盘; (3) no_root_squash服务器共享目录用户的属性,如果用户是root,那么对于这个共享目录来说就具有root的权限 1.6重启NFS服务 /etc/init.d/nfs-kernel-serverrestart 2.部署NFS client端 2.1安装nfs-common sudo apt-get install nfs-common 2.2挂载NFS 如:将192.168.71.205 NFS服务端的/home/挂载到192.168.71.46的NFS客户端上,在192.168.71.46机器上 执行: mount-t nfs -o tcp,soft,intr,timeo=50,retrans=12, 192.168.71.205:/home /home/testclient(这两 个目录必须是两台机器上已存在的)。 2.3检查挂载是否成功 df 2.4卸载 unmount /home/testclient 查看本栏目更多精彩内容:http://www.bianceng.cn/OS/Linux/ (编辑:应用网_丽江站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |