Redhat7配置NFS

Redhat7配置NFS


安装:

# yuminstall nfs-utils  (或rpm -i

 

共享/home

# vi/etc/exports

 

/home     10.0.0.3(rw,async,root_squash)

 

:wq

 

全部参数为:ro,rw,async,sync,root_squash,no_root_squash,all_squash

 

可为单个ip,可为网段(如:10.0.0.0/24),可为域名(如:*.ming.com

 

启动nfs

#systemctl start nfs-server

 

exportfs�Carv =  systemctl restart nfs-server

 

开机启动nfs

#systemctl enable nfs-server

 

开启防火墙:

#firewall-cmd �Cpermanent �Cadd-service=nfs

#firewall-cmd �Cpermanent �Cadd-service=mountd

#firewall-cmd �Cpermanent �Cadd-service=rpc-bind

 

客户端:

 

查看服务器端共享:

#showmount �Ce 10.0.0.2

 

挂载:

# mount �Ctnfs 10.0.0.2:/home  /aa

 

写到/etc/fstab

# vi/etc/fstab

10.0.0.2:/home   /aa nfs    defaults   0 0

:wq

 


你可能感兴趣的:(nfs)