通过ssh登录centos7
Posted jenkins
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了通过ssh登录centos7相关的知识,希望对你有一定的参考价值。
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的主要内容,如果未能解决你的问题,请参考以下文章