当前位置: 首页 > news >正文

cse复习 文件共享 nfs服务

实验一 二  服务端建立nfs服务 客户端挂载该服务

服务端


[root@server ~]# dnf install nfs-utils -y
正在更新 Subscription Management 软件仓库。[root@server ~]# mkdir /nfs_server[root@server ~]# setenforce 0
[root@server ~]# getenforce
Permissive
[root@server ~]# systemctl status firewalld
○ firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)[root@server ~]# vim /etc/exports[root@server ~]# exportfs -rv
exporting 192.168.25.200:/nfs_server
[root@server ~]# ^C[root@server ~]#
[root@server ~]# chmod 777 /nfs_server
[root@server ~]#

客户端


[root@client yum.repos.d]# dnf install nfs-utils -y
正在更新 Subscription Management 软件仓库。[root@client yum.repos.d]# showmount -e 192.168.25.150
Export list for 192.168.25.150:
/nfs_server 192.168.25.200
[root@client yum.repos.d]#[root@client yum.repos.d]# showmount -e 192.168.25.150
Export list for 192.168.25.150:
/nfs_server 192.168.25.200
[root@client yum.repos.d]# mkdir /nfs_client
mkdir: 无法创建目录 “/nfs_client”: 文件已存在
[root@client yum.repos.d]# mount 192.168.25.150:/nfs_server /nfs_client
[root@client yum.repos.d]# cd /nfs_client/
[root@client nfs_client]# touch 1
touch: 无法创建 '1': 权限不够
# 写不进去 是因为在服务器上被映射为了nobody 属于其他人权限组 该组没有写权限 所以 在服务端修改目录权限 即可
[root@client nfs_client]# touch 1
[root@client nfs_client]#

实验4,实现自动挂载并实现不操作 5秒后自动取消挂载


[root@client nfs_client]# yum install autofs -y
正在更新 Subscription Management 软件仓库。已升级:autofs-1:5.1.7-65.el9.x86_64完毕![root@client nfs_client]# vim /etc/autofs.conf[root@client nfs_client]# systemctl  enable --now autofs
Created symlink /etc/systemd/system/multi-user.target.wants/autofs.service → /usr/lib/systemd/system/autofs.service.[root@client nfs_client]# cd /net/192.168.25.150[root@client 192.168.25.150]# ls
nfs_server
[root@client 192.168.25.150]# cd /net/192.168.25.150/nfs_server/
[root@client nfs_server]# ls
1

实验五,指定自动挂载的目录

[root@client nfs_server]# vim /etc/auto.master
[root@client nfs_server]# cat /etc/auto.master | head -15
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
/misc   /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#       "nosuid" and "nodev" options unless the "suid" and "dev"
#       options are explicitly given.
#
/net    -hosts/nfs_auto /etc/auto.nfs_auto[root@client nfs_auto]# vim /etc/auto.nfs_auto
[root@client nfs_auto]# systemctl restart autofs.service[root@client nfs_auto]# cat /etc/auto.nfs_auto
fromserver 192.168.25.150:/nfs_server
[root@client nfs_auto]# tree /nfs_auto
/nfs_auto0 directories, 0 files
[root@client nfs_auto]# cd /nfs_auto/fromserver
[root@client fromserver]# ls
1
[root@client fromserver]# ll
总用量 0
-rw-r--r--. 1 nobody nobody 0 10月 31 20:47 1
http://www.dtcms.com/a/555230.html

相关文章:

  • 广州企业自助建站哈尔滨网页制作要多少钱
  • 360网站推广官网硅钙钾镁肥做性视频网站有哪些
  • 一起做单网站怎么样最流行网站开发工具
  • Sora 2:从视频生成到世界模拟,OpenAI的“终极游戏”
  • 网站建设开发ppt模板今天无法登陆建设银行网站呢
  • Redis哨兵与集群模式
  • 慈溪市建设局网站西安市建设工程信息网诚信信息平台官网
  • 网站后台上传图片步骤网络营销的50种方法
  • 电子商务网站建设实训步骤wordpress双击返回顶部
  • 网站地图用什么格式ps国外教程网站
  • 在线网站seo诊断自动化东莞网站建设
  • 解决Nacos发布配置失败问题
  • 编写Netfilter模块过滤ARP数据包
  • 呼吸能量饮食饮水代谢检测系统 多通道小动物代谢监控系统 小动物代谢检测系统
  • 图片网站怎么建设网站开发需求问卷
  • 前端很难学吗seo服务方案
  • 优化网站软文东莞石龙网站建设
  • 二手设备回收做哪个网站好h5游戏是什么意思
  • 顺德做网站设计的公司丹灶网站制作
  • 网站建设的7种流程图公司网站页脚
  • 网站设计论文题目网站备案手机号码
  • 潍坊400建网站公司小孩子做手工做游戏的网站
  • VTK开源视觉库 | 行业应用第一篇
  • 网站页面分辨率鞍山网站制作谁家好
  • 延安免费做网站公司个人免费网站建设
  • C++ / Linux 学习 Day 2:引用、拷贝构造 与 auto.sh 自动编译脚本
  • 站长统计工具山西网站建设网站
  • 国外网站需要备案郴州百度seo
  • 北京孤儿院做义工网站三大电商平台
  • 关键词优化排名网站php企业网站开发实验总结