1. 程式人生 > >Git註冊SSH key流程

Git註冊SSH key流程

1.    檢查是否已經有SSH Key

  $cd ~/.ssh

如果沒有金鑰則不會有此資料夾,有則備份刪除

2、設定git 的username 和email                    

$ git config --global user.name "weimeng"

$ git config --global user.email "[email protected]"

3、生成SSH金鑰過程

$ ssh-keygen -t rsa -C “[email protected]

按3個回車,密碼為空。

Your identification has been saved in /home/tekkub/.ssh/id_rsa.

Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.

The key fingerprint is:

最後得到了兩個檔案:id_rsa和id_rsa.pub

4.在github上新增ssh金鑰

開啟這 “id_rsa.pub”裡面的公鑰複製SSH key中

5.測試:ssh [email protected]

The authenticity of host ‘github.com (207.97.227.239)’ can’t be established.

RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ‘github.com,207.97.227.239′ (RSA) to the list of known hosts.

ERROR: Hi tekkub! You’ve successfully authenticated, but GitHub does not provide shell access

Connection to github.com closed.

6.開始使用github

1.獲取原始碼:

$ git clone ssh://[email protected]:8022/fonova_dmp/dmp-restapi.git