构建密钥对验证SSH体系的基本过程包括四步:SSH客户端:192.168.1.1
SSH服务器:192.168.1.2
1、在客户端创建密钥对:
[root@localhost /]# ssh-keygen -t ecdsa
“ -t ” 用来指定加密算法,这里使用ecdsa,还有一个是dsa。
Generating public/private ecdsa key pair.
Enter file in which to save the key (/root/.ssh/id_ecdsa):
#指定私钥存放位置,若直接按enter,则默认保存在宿主目录中的隐藏文件夹中.ssh下。
Created directory ‘/root/.ssh’.
Enter passphrase (empty for no passphrase): #设置私钥短语
Enter same passphrase again: #确认所设置的短语
..........................
±–[ECDSA 256]—+
| … =oo.+o. |
| .=.= *.o.oo|
| +.= = B oo+|
| . = = B . = |
| . o S o . = |
| + o = o . . |
| = = . . |
| + E .