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

2021-10-31

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

2021-10-31

1、开放/nfs/shared目录,供所有用户查询资料;

服务端:

关闭防火墙和selinux:

[root@server ~]# systemctl stop firewalld

[root@server ~]# setenforce 0

[root@server ~]# getenforce

Permissive

创建要共享的目录文件

[root@server ~]# mkdir /nfs/shared -p

安装NFS

[root@server ~]# yum install rpcbind

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

编辑配置文件和共享目录:

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

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

启动服务:

[root@server ~]# systemctl status rpcbind

[root@server ~]# systemctl restart rpcbind

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

[root@server ~]# showmount -e 192.168.189.143

客户端:

关闭防火墙和selinux:

[root@client ~]# systemctl stop firewalld

[root@client ~]# setenforce 0

[root@client ~]# getenforce

Permissive

安装NFS

[root@server ~]# yum install rpcbind

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

查看共享目录

[root@client ~]# showmount -e 192.168.189.143

挂载服务端的共享文件到/wang

[root@client ~]# mount -t nfs 192.168.189.143:/nfs/shared /wang

2、开放/nfs/upload目录,供所有用户上传下载资料;

服务端:

编辑配置文件和共享目录:

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

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

创建目录和修改权限:

[root@server ~]# mkdir /nfs/upload -p

[root@server ~]# chmod 767 /nfs/upload/

重启服务:

[root@server ~]# systemctl restart nfs-server rpcbind

客户端:

为/nfs/upload创建挂载目录/mnt1

[root@client ~]# mkdir /mnt

测试:

2、搭建时间服务器,客户端可在每天早晨的9:00整从ntp服务器更新自己的时间

服务端:

关闭防火墙和selinux:

[root@server ~]# systemctl stop firewalld

[root@server ~]# setenforce 0

装包:

[root@server ~]# yum install -y chrony

编写配置文件:

[root@sever~]# vim /etc/chrony.conf

重启服务:

[root@sever ~]# systemctl restart chronyd

客户端:

装包:

[root@client ~]# yum install -y chrony

编写配置文件:

[root@client ~]# vim /etc/chrony.conf

重启服务:

[root@client ~]# systemctl restart chronyd

[root@client ~]# chronyc sources

服务端修改时间:

客户端同步时间:

使用计划任务自动更新客户端的时间,编辑/etc/crontab文件

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

                               

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

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

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