# NFS
server:192.168.47.13
client:192.168.47.12
#安装NFS服务
apt-get install nfs-kernel-server
#安装代理
apt-get install rpcbind
service nfs-kernel-server status
groupadd oldwang -g 888
useradd oldwang -u 888 -g oldwang
id oldwang
mkdir /data/
chown -R oldwang.oldwang /data
#注意先启动rpcbind 在启动nfs(顺序不对showmount容易报错)(showmount命令是用于从NFS客户端检查服务端贡献目录情况的命令)
echo ' #new example'>> /etc/exports
echo ‘/data 192.168.47.13/24(rw,sync,all_squash,anonuid=888,anongid=888) '>> /etc/exports:wq
exportfs -rv (重新加载,每次改完配置文件都要输入这个命令
showmount -e localhost
客户端配置:
groupadd oldwang -g 888
useradd oldwang -u 888 -g oldwang
id oldwang
mkdir testnfs
/etc/init.d/rpcbind status
showmount -e 192.168.47.13
mount -t nfs 192.168.47.13:/data /testnfs