1.配置ntp时间服务器,确保客户端主机能和服务主机同步时间
1.查看是否存在
2.查看是否运行
3.进入chrony.conf进行同步时间
4. 进行如下配置
(开启层级位10,层级越小优先级越高,允许客户端)
5.关闭防火墙
6.关闭selinux
7.重启服务
8.在客户端配置
9.开始同步
2.配置ssh免密登陆,能够通过客户端主机通过redhat用户和服务端主机基于公钥验证方式进行远程连接
1.创建用户redhat
2.创建密钥
[m_yu@location ~]# ssh-keygeb -t rsa
bash: ssh-keygeb: command not found...
[m_yu@location ~]# su redhat
[redhat@location]$ 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:XHjKTBPG5CQriq9O0Fe2fAEUzxTmeCC2s6gtrkdckCE redhat@location
The key's randomart image is:
+---[RSA 3072]----+
|E .oo.*+O. |
| .o. o /.o |
| .+ = @ o |
| o o.B B * |
|o.+.o o S |
|.+o. . |
|ooo |
|oo. |
|=+ |
+----[SHA256]-----+
[redhat@location]$
[redhat@location]$ ssh-copy-id root@192.168.183.128
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/redhat/.ssh/id_rsa.pub"
The authenticity of host '192.168.183.128 (192.168.183.128)' can't be established.
ED25519 key fingerprint is SHA256:MK3vrSRPaKvJHtkQrrGnUqHK2sKzyWj6PCwnZwC6GkY.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.239.100's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'root@192.168.239.100'"
and check to make sure that only the key(s) you wanted were added.
[redhat@location]$ ssh root@192.168.239.100
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: Wed Apr 17 013:16:42 2023 from 192.168.239.100
[root@server ~]#
[root@server ~]#
3.客户端测试
[redhat@location]$ ssh root@192.168.239.130
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: Wed Apr 17 013:16:42 2023 from 192.168.239.100
[root@server ~]#