服务端生成密钥和公钥
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:/gGrlDJN5euMS5aai5feBkEI/0WjEnzPzx1xGtdkKG4 [email protected]
The key's randomart image is:
+---[RSA 2048]----+
|.o.. o +o |
| .o.oo . + +.. |
| oo.o. .. B |
| o..oo E |
| ...oSo . |
| .o +o+. |
| ooB + . |
| .oX.= . . |
| .o=o=.o . |
+----[SHA256]-----+
Generating public/priv