[root@mouse ~]# hostname server
[root@mouse ~]# bash
[root@mouse ~]# vim /etc/chrony.conf
allow 192.168.152.112
local stratum 10
[root@mouse ~]# systemctl restart chronyd
[root@mouse ~]# date
2022年 08月 27日 星期六 23:13:07 CST
[root@mouse ~]# date
[root@mouse ~]# vim /etc/chrony.conf
pool 192.168.229.132 iburst
[root@mouse ~]# systemctl restart chronyd
[root@mouse ~]# date
2022年 08月 27日 星期六 23:13:07 CST
[root@mouse ~]# ssh-keygen -t rsa #只有这一句代码,其他是代码效果
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:18x32WiyP2uPpYnyiimGdL7/2tzRbJhS7MHw1niZrgQ root@localhost.localdomain
The key's randomart image is:
+---[RSA 3072]----+
| |
| |
| . |
| O o +o|
| S E & O.o|
| . . . = & . |
| . + . B = .|
| . + =.+ *o= |
| ..+=o=+=.*+.|
+----[SHA256]-----+
[root@mouse ~]# ssh-copy-id -i kou@192.168.152.112 #只有这一句代码,其他是代码效果
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/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
kou@192.168.229.132's password:
Permission denied, please try again.
kou@192.168.229.132's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'kou@192.168.152.112'"
and check to make sure that only the key(s) you wanted were added.
[root@mouse ~]# ssh kou@192.168.229.132 #只有这一句代码,其他是代码效果
Activate the web console with: systemctl enable --now cockpit.socket
This system is not registered to Red Hat Insights. See https://cloud.redhat.com/
To register this system, run: insights-client --register
Last failed login: Sat Aug 27 23:22:44 CST 2022 from 192.168.229.131 on ssh:notty
There were 2 failed login attempts since the last successful login.
Last login: Sat Aug 27 22:22:01 2022 from 192.168.229.1
[kou@server ~]$ #出现这个server,证明成功了