当前位置: 首页 > Linux

通过ssh登录centos

时间:2023-04-06 23:39:07 Linux

执行命令ssh-keygen-trsa==使用rsa协议生成公私钥==2。确认三次,使用默认存储位置,密码为空,确认密码为空[root@iZbp1gg50ddqbgxf1jpqwwZ~]#ssh-keygen-trsa生成公私rsa密钥对。输入保存密钥的文件(/root/.ssh/id_rsa):Enterpassphrase(emptyfornopassphrase):Entersamepassphraseagain:Youridentificationhasbeensavedin/root/.ssh/id_rsa.Yourpublickeyhasbeensavedin/root/.ssh/id_rsa.pub.Key指纹为:SHA256:291afX8QKD/Ys+Ji/tbtKyC/lZXfSNoqmV6IVlFiy/Uroot@iZbp1gg50ddqbgxf1jpqwwZThekey'simagerandomis:--[RSA2048]----+|哦||o=。||+.E||.....||S.=+。||.=oo=B.+.||+oo=*==.=||.o博++。+||o.*=+ooo.o|+----[SHA256]-----+/root/.ssh公钥私钥存放位置[root@iZbp1gg50ddqbgxf1jpqwwZ.ssh]#lltotal8-rw-------1rootroot0Jan1621:37authorized_keys-rw------1rootroot1679Jan2015:40id_rsa-rw-r--r--1rootroot410Jan2015:40id_rsa.pub打开公钥登录日志服务器catid_rsa.pub>>authorized_keys