Ubuntu 12.04安装NFS server



Ubuntu 12.04安装NFS server
 
首先安装nfs-kernel-server
 
[plain] 
apt-get install nfs-kernel-server  
 
然后创建一个目录:
[plain] 
mkdir -p /opt/share  
 
并赋予权限777:
[plain] 
chmod -R 777 /opt/share  
  www.2cto.com  
在/etc/exports文件中添加配置:
[plain] 
/opt/share 10.112.18.0/255.255.255.0(rw,no_root_squash)  
 
在/etc/hosts.allow中添加配置:
[plain] 
portmap:10.112.18.0/255.255.255.0  
 
在/etc/hosts.deny中添加配置:
[plain] 
portmap:ALL  
 
重新启动两个服务:
[plain] 
service portmap restart  
service nfs-kernel-server restart  
在另一台Ubuntu上安装nfs-common
 
[plain] 
apt-get install nfs-common  
  www.2cto.com  
然后创建目录test
[plain] 
mkdir ~/test  
然后运行测试命令看一下:
[plain] 
# showmount -e 10.112.18.158  
Export list for 10.112.18.158:  
/opt/share 10.112.18.0/255.255.255.0  
 
找到nfs server的挂载目录了。现在手工挂载:
[plain] 
mount -t nfs4 10.112.18.158:/opt/share ~/test/  
 
现在可以测试了,应该成功。
 

相关内容

    暂无相关文章