到當前用戶目錄下
cd ~
/home/[user]
找到 .ssh目錄
cd .ssh
ssh-keygen -t rsa 執行創建密鑰對命令
Generating public/private rsa key pair.
Please be patient.... Key generation may take a few minutes
Enter file in which to save the key (/home/ap/appnms/.ssh/id_rsa):
# 按回車保存為: //.ssh/id_rsa,即當前用戶的私鑰 私鑰名稱可以在這里自定義
Enter passphrase (empty for no passphrase):
# 按回車,表示讀取密鑰時不需要密鑰的密碼
Enter same passphrase again:
# 確認密鑰的密碼,必須和上面的輸入相同
Your identification has been saved in /home/ap/appnms/.ssh/id_rsa.
# 私鑰保存信息
Your public key has been saved in /home/ap/appnms/.ssh/id_rsa.pub.
# 公鑰保存信息
The key fingerprint is:
31:03:78:64:4f:8e:9d:a9:31:bf:38:5d:1a:79:08:e6 appnms@T254N0V4
# 密鑰指紋
The key's randomart image is:
+--[ RSA 2048]----+
| o+ . |
| ...B o |
| .* X |
| o * * |
| E S o |
| o * |
| o + |
| . |
| |
+-----------------+