码迷,mamicode.com
首页 > 其他好文 > 详细

通过ssh登录centos7

时间:2020-01-22 16:04:54      阅读:76      评论:0      收藏:0      [点我收藏+]

标签:authorize   air   SHA256   roo   默认   dom   key pair   int   file   

1.执行指令

ssh-keygen -t rsa

==使用rsa协议生成公匙和私匙==
2.三次确认,使用默认存放位置,密码为空,确认密码为空

[root@iZbp1gg50ddqbgxf1jpqwwZ ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
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:291afX8QKD/Ys+Ji/tbtKyC/lZXfSNoqmV6IVlFiy/U root@iZbp1gg50ddqbgxf1jpqwwZ
The key's randomart image is:
+---[RSA 2048]----+
|          o o    |
|         o = .   |
|          +  .E  |
|          ... .. |
|        S .=  +. |
|        .=oo=B.+.|
|        +oo=*==.=|
|       .o Bo++. +|
|       o.*=+ooo.o|
+----[SHA256]-----+

3./root/.ssh 公匙和私匙存放位置

[root@iZbp1gg50ddqbgxf1jpqwwZ .ssh]# ll
total 8
-rw------- 1 root root    0 Jan 16 21:37 authorized_keys
-rw------- 1 root root 1679 Jan 20 15:40 id_rsa
-rw-r--r-- 1 root root  410 Jan 20 15:40 id_rsa.pub

4.开放公匙登录服务器

cat id_rsa.pub >> authorized_keys

通过ssh登录centos7

标签:authorize   air   SHA256   roo   默认   dom   key pair   int   file   

原文地址:https://www.cnblogs.com/jenkins/p/12228559.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!