centos共享远程目录

admin6年前IT技术1521

服务器端设置:
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也可以

 

 

相关文章

解决方案2
打开的本地组策略

Win10远程连接的凭据不工作的解决方法

 把远程桌面工具的本地资源的打印机与剪贴板的勾勾取消解决方案2打开的本地组策略在右侧打开的窗口中双击“网络访问:本地账户的共享和安全模型”一项在打开的属性窗口中,我们...

服务器上使用WMI报 '80041003' Automation 错误的解决办法

服务器上使用WMI报 '80041003' Automation 错误的解决办法

我在网上找的获取cpuid的vb代码,直接在vb中运行正常,我把它打包成dll文件,在asp中引用总是报下面错误 原因:'80041003'  Automation 错误&nbs...

GIt后悔药:还原提交操作(谨慎操作)

GIt后悔药:还原提交操作(谨慎操作)

GIt后悔药:还原提交操作(谨慎操作)一、背景:偶尔会遇到git的版本分支的文件被误改的情况,需要还原,此篇文章可能会帮助到你。PS:来理解下 Git 工作区、暂存区和版本库概念,可以更好的理解以下的...

sql语句 REPLACE 区分大小写字母的

 REPLACE  sql语句 REPLACE 区分大小写字母的;要注意...

让MobaXterm能自动显示服务器的cpu与内存使用情况

 Settings→SSH→勾选Remote-monitoring...

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

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

发表评论    

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