栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

centos7虚拟机NFS配置

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

centos7虚拟机NFS配置

server

#安装nfs*

[root@server ~]# yum -y install nfs-utils

#开机自启动nfs*

[root@server ~]# systemctl enable nfs-server

#启动nfs

[root@server ~]# systemctl start nfs-server

#查看nfs是否启动(相同)

[root@server ~]# systemctl status nfs-server

[root@server ~]# systemctl is-active nfs-server

#创建文件share和privacy

[root@server ~]# mkdir /share

[root@server ~]# mkdir /privacy

#输入参数

[root@server ~]# vim /etc/exports

#参数

/share          192.168.1.0/24(ro)

/privacy        192.168.1.20/24(rw,sync)

#重新加载

[root@server ~]# exportfs -r

#重新输出

[root@server ~]# exportfs -v

#给share和privacy添加文件

[root@server ~]# echo "hello,world"> /share/text

[root@server ~]# echo "hello,evryone"> /privacy/txt

#查看共享的文件

[root@server ~]# showmount -e 192.168.1.10

#添加读写执行权限

[root@server ~]# chmod 755 /share

[root@server ~]# chmod 777 /privacy

#查看读写执行权限的参数

[root@server ~]# ll -d /share

[root@server ~]# ll -d /privacy

client

#安装nfs*

[root@server ~]# yum -y install nfs-utils

#开机自启动nfs*

[root@server ~]# systemctl enable nfs-server

#启动nfs

[root@server ~]# systemctl start nfs-server

#查看nfs是否启动(相同)

[root@server ~]# systemctl status nfs-server

[root@server ~]# systemctl is-active nfs-server

#到mnt目录

[root@client zard]# cd /mnt

#查看文件

[root@client mnt]# ls

#创建文件(cd /mnt/)

[root@client mnt]# mkdir share

[root@client mnt]# mkdir privacy

#挂载

[root@client mnt]# mount -t nfs 192.168.1.10:/share /mnt/share

[root@client ~]# mount -t nfs 192.168.1.10:/privacy /mnt/privacy

#挂载只读

[root@client mnt]# mount -t nfs -o -ro192.168.1.10:/share /mnt/share

[root@client mnt]# mount

#取消挂载

[root@client mnt]# umount /mnt/share

#到根目录创建aaa

测试开始

#privacy 读写验证

[root@client ~]# cd /mnt/privacy

[root@client privacy]# touch aaa

#share 只读验证

[root@client ~]# cd /mnt/share

[root@localhost share]# ls

text

[root@localhost share]# touch jpeg

#查看挂载

[root@client privacy]# ll

[root@client ~]# showmount 192.168.1.10 -e

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/831360.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号