使用ssh-keygen生成密鑰


ssh-keygen 用於生成、管理和轉換認證密鑰,包括 RSA 和 DSA 兩種密鑰。

  • 密鑰類型可以用 -t 選項指定。如果沒有指定則默認生成用於SSH-2的RSA密鑰。

下面使用的參數 -t 也是默認的,可以不用。

這里我們在第三行,我們輸入了 /Users/guohongjun/.ssh/dianping_rsa ,也就是我們所希望的ssh密鑰的名字以及路徑。 其他均選擇的是默認參數回車。

% ssh-keygen -t rsa -C "guohongjun@aaa.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/guohongjun/.ssh/id_rsa): /Users/guohongjun/.ssh/dianping_rsa
Enter passphrase (empty for no passphrase): 回車
Enter same passphrase again: 回車
Your identification has been saved in /Users/guohongjun/.ssh/dianping_rsa.
Your public key has been saved in /Users/guohongjun/.ssh/dianping_rsa.pub.
The key fingerprint is:
SHA256:lkDYKGrjNG+zSB70s9H9BWQ/ynIqIidg8USzJSxYVtU guohongjun@aaa.com
The key's randomart image is:
+---[RSA 3072]----+
|..+..=o.         |
|.o.=oo. Eo       |
| .o.= . o .      |
|.B o   . o o     |
|= O . . S o .    |
|.= O . + + .     |
|= + *   = .      |
| = = . . .       |
|  + . .          |
+----[SHA256]-----+

參考:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM