NFS服务器配置:
1、安装NFS相关包
apt-get install nfs-kernel-server nfs-common
# centos 7
# yum install nfs-utils
2、配置NFS目录和权限
vim /etc/exports
在最后一行添加
/nfsdir *(rw,sync,no_root_squash)
3、重启服务
/etc/init.d/nfs-kernel-server restart
# centos 7
# systemctl enable nfs-server && systemctl start nfs-server
NFS客户端配置:
1、安装NFS客户端
apt-get install nfs-common
2、查看NFS服务器共享目录
showmount -e nfs-server-ip
3、将目录挂载到本地
mount nfs-server-ip:/nfsdir /mnt
4、开机自动挂载
vim /etc/fstab
nfs-server-ip:/nfsdir /mnt nfs rw 0 0
本文介绍了如何在CentOS 7环境下配置NFS服务器及客户端。包括安装NFS相关软件包、配置共享目录权限、重启服务使配置生效等内容。同时,还提供了客户端的配置步骤,如安装客户端软件、查看服务器共享目录、挂载目录等。
362

被折叠的 条评论
为什么被折叠?



