rhce!

该文本展示了在Linux系统中使用chrony配置NTP服务器,设置本地时区,生成SSH密钥对,并尝试通过ssh-copy-id将公钥复制到远程主机以实现无密码登录的过程。然而,在最后的SSH登录尝试中遇到了权限问题。
摘要由CSDN通过智能技术生成
[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,证明成功了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值