1. 程式人生 > >ubuntu 如何生成祕鑰(ssh key)

ubuntu 如何生成祕鑰(ssh key)

ubuntu 如何生成ssh key以及如何檢視ssh key
1.檢查本地是否有SSH Key存在
在終端輸入

ls -al ~/.ssh

2.如果輸出的是:

No such file or directory

3.那就沒有ssh key
如果有就會出現這樣:生成新的SSH key
4.首先在終端輸入

ssh-keygen -t rsa -C "[email protected]"

5.之後一路回車鍵(Enter),就生成了;

Generating public/private rsa key pair.
Enter file in which to
save the key (/home/your_email/.ssh/id_rsa): Created directory '/home/your_email/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/your_email/.ssh/id_rsa. Your public key has been saved in /home/your_email/.ssh/id_rsa.pub. The key fingerprint is
: 85:60:59:1a:77:45:22:b5:56:c1:10:4e:1f:9f:6f:c8 [email protected] The key's randomart image is: |**生成的圖+

6.最後生成的祕鑰在/home/use/生成一個隱藏檔案.ssh,開啟隱藏檔案,進去兩個檔案id_rsa 和 id_rsa.pub,
id_rsa.pub是你的公鑰,把這個新增進你所工作的專案中就可以使用了;