centos共享远程目录

admin5年前IT技术926

服务器端设置:
1.安装依赖包 yum -y install nfs*
2.修改文件vim /etc/exports   添加如下内容
    /要共享的目录路径   客户端ip/24(rw,no_root_squash,sync,no_wdelay)
3.启动nfs,rpcbind,并设为开机自启
(centos7)
systemctl start nfs
systemctl start rpcbind
systemctl enable nfs
systemctl enable rpcbind
4.查看是否共享成功
showmount -e localhost
5.关闭防火墙
systemctl stop firewalld
systemctl disable firewalld.service
客户端设置:
 1.安装依赖包 yum -y install nfs*  
2.启动nfs (centos7)
systemctl start nfs
systemctl start rpcbind
systemctl enable nfs
systemctl enable rpcbind
3.检测服务器 showmount -e 服务器IP
4.网络挂载  这一步可以不操作
mount -t nfs -o nolock 服务端IP:共享目录绝对路径 本地挂载目录
5.开机自动挂载
vi /etc/fstab # 新增一行 服务端IP:/服务器目录/      /本地目录 nfs4 defaults 0 0
centos7的nfs默认使用的是nfs4,所以mount -t 无需指定nfs4也可以

 

 

相关文章

mount:is write-protected, mounting read-only解决方案

window10升级之后就遇到mount: **** is write-protected, mounting read-onlymount: cannot mount *** read-only尝试...

windows11 的windows安全中心 无法打开

解决方案:1.使用管理员权限从搜索或开始菜单中打开 Windows PowerShell。2.复制并粘贴Get-AppxPackage Microsoft.SecHealthUI -AllUsers...

VB封装ASP 记录集

 定义字符VERSION 1.0 CLASSBEGIN  MultiUse = -1  'True ...

解决Cannot load php7apache2_4.dll into server导致无法启动Apache

萌新在面对服务端开发使用PHP搭配Apache时会遇见Cannot load php7apache2_4.dll into server 例如 01 最最最主要的问题 Apache...

未命名

<?phpnamespace Article;class Comment { }namespace MessageBoard;class Comment { }//调用当前空间(MessageB...

MobaXterm监控服务器的资源

MobaXterm监控服务器的资源

使用服务器的时候比较喜欢随时查看的服务器资源使用情况,比如内存,CPU,网速,磁盘使用等情况,一次偶然的机会发现了如果你发现你的会话窗口底部没有,可以这样开启: Settings→SSH→勾选Remo...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。