在CentOS上搭建NFS服务器

环境:CentOS5.2

由于CentOS里面已经装了NFS服务,故不需要安装该服务,只需要进行如下的设置即可:

1、 修改**/etc/exports**文件,添加如下内容:

bash 复制代码
/home/guochongxin *(rw,sync,no_root_squash)

保存后执行:

bash 复制代码
exportfs --r

2、 重启服务:

bash 复制代码
/etc/init.d/nfs restart

bash 复制代码
service nfs restart

3、 测试:

创建**/tmp/test/**目录:

bash 复制代码
mkdir /tmp/test/

挂载网络文件系统:

bash 复制代码
mount 127.0.0.1:/home/guochongxin /mnt/test

进入到挂载的目录cd /mnt/test ,然后列表显示ls

如果测试时访问不到,可能是防火墙的关系,进行下面操作把防火墙停了:

bash 复制代码
service iptables stop
service ip6tables stop
相关推荐
十年磨一剑~2 小时前
Linux程序接收到sigpipe信号崩溃处理
linux
geshifei2 小时前
Sched ext回调3——select_cpu(linux 6.15.7)
linux·ebpf
代码游侠3 小时前
C语言核心概念复习——网络协议与TCP/IP
linux·运维·服务器·网络·算法
你真是饿了3 小时前
6.库制作与原理
linux·服务器
Zach_yuan4 小时前
深入浅出 JSONCpp
linux·服务器·网络·c++
北京迅为5 小时前
《【北京迅为】itop-3568开发板NPU使用手册》- 第 7章 使用RKNN-Toolkit-lite2
linux·人工智能·嵌入式·npu
Dragon~Snow5 小时前
Linux Centos9 安装 Elasticsearch
linux·elasticsearch·jenkins
熊延5 小时前
麒麟V10系统安装部署elasticsearch
linux·运维·服务器·elasticsearch·搜索引擎·全文检索
Jia ming5 小时前
跟踪器与事件使用举例
linux·事件·跟踪器
生活很暖很治愈5 小时前
Linux——基础IO&软硬链接
linux·ubuntu