配置ntp时间服务器,确保客户端主机能和服务主机同步时间

配置ntp时间服务器,确保客户端主机能和服务主机同步时间

1配置Chrony服务器

先下载chrony

dnf install -y chrony

在这里插入图片描述

查看和配置chrony.conf文件

rpm -qc chrony
vim /etc/chrony.conf

在这里插入图片描述

配置的时阿里云的时间服务器

pool ntp.aliyun.com iburst
在这里插入图片描述

允许192.168.169.0/24网段的客户端使用

allow 192.168.17.131/24

local stratum 10
在这里插入图片描述
在这里插入图片描述

启动服务

systemctl enable --now chronyd
systemctl status chronyd

在这里插入图片描述

主机的防火强需要放行ntp

firewall-cmd --permanent --add-service=ntp
firewall-cmd --reload
firewall-cmd --list-all
setenforce 0
systemctl restart chronyd

在这里插入图片描述
在这里插入图片描述

查看端口

chronyc sources

在这里插入图片描述

2、配置客户端如下:
dnf install -y chrony
vim /etc/chrony.conf

pool 192.168.17.131 iburst
在这里插入图片描述
在这里插入图片描述

其他同上

2.配置ssh免密登陆,能够通过客户端主机通过redhat用户和服务端主机基于公钥验证方式进行远程连接

1、创建新用户
useradd redhat
passwd redhat

Changing password for user redhat.
New password:

BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
在这里插入图片描述

二,创建新的密钥对,并且发送到指定目录
[redhat@bogon ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/redhat/.ssh/id_rsa): 
Created directory '/home/redhat/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/redhat/.ssh/id_rsa
Your public key has been saved in /home/redhat/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:9RYttneqph5LbmP7enILEkgez3i97SX4+qC34isHj0U redhat@bogon
The key's randomart image is:
+---[RSA 3072]----+
|                 |
|             .   |
|      o   . + .  |
|     o *Eo o +   |
|      +.S . + . .|
|      .... = . o |
|       =. B o o  |
|      o +=*B++   |
|       ++BX#B.   |
+----[SHA256]-----+
[redhat@bogon ~]$ 
[redhat@bogon ~]$ ssh 'root@192.168.17.130'
The authenticity of host '192.168.17.130 (192.168.17.130)' can't be established.
ED25519 key fingerprint is SHA256:WUf4aCKByXGl0sHjcLgX0wJ9gZ/pxgJX/KK+LxOUJN0.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? y
Please type 'yes', 'no' or the fingerprint: y
Please type 'yes', 'no' or the fingerprint: n^Hyes^H^H^H^H^C
[redhat@bogon ~]$ ssh 'root@192.168.17.130'
The authenticity of host '192.168.17.130 (192.168.17.130)' can't be established.
ED25519 key fingerprint is SHA256:WUf4aCKByXGl0sHjcLgX0wJ9gZ/pxgJX/KK+LxOUJN0.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.17.130' (ED25519) to the list of known hosts.
root@192.168.17.130's password: 
Activate the web console with: systemctl enable --now cockpit.socket

Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
Last login: Sun Apr  9 21:25:30 2023 from 192.168.17.1
[root@bogon ~]# 
[root@bogon ~]# 

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

孤冢清风666

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值