redhat,ubuntu,Fedora搭建NFS

来源:互联网 发布:工程套价软件 编辑:程序博客网 时间:2024/05/20 00:11

先在宿主机上的/etc/exports/下添加一行:

/zsj 192.168.0.*(rw,sync,no_subtree_check,no_root_squash)

/zsj 【共享目录】192.168.0.*【共享的网络段,*为所以能ping通的电脑此处与接下来的权限参数直接无空格】(rw【读写】,sync,no_subtree_check【无验证】,no_root_squash【无锁定】)

如果宿主机为虚拟机,需注意宿主机要使用桥接方式连接网络

然后重启portmap ,nfs服务,命令为:service portmap restart

                                                                service nfs restart(ubuntu下 为nfs-kernel-server)


客户机:

1.必须能ping通主机,切在共享网络段中

2.Mount –t nfs –o nolock192.168.0.100:/zsj /mnt 将共享目录zsj挂载到本地的/mnt


Fedora下需关闭防火墙,不用管portmap

service iptables stop