git.coding.net 配置SSH公鑰私鑰

####### 配置公鑰私鑰
用git去管理代碼現在已經屬於主流了,所以配置SSH會防止每次pull,push 都需要輸入賬號密碼。

Mac/Linux 打開命令行終端, Windows 打開 Git Bash 。 輸入ssh-keygen -t rsa -C “[email protected]”,( 註冊的郵箱),接下來點擊enter鍵即可(也可以輸入密碼)。
ssh-keygen -t rsa -b 4096 -C "[email protected]" 
成功之後
Your identification has been saved in /Users/you/.ssh/id_rsa.
# Your public key has been saved in /Users/you/.ssh/id_rsa.pub.
# The key fingerprint is:
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db [email protected]
 $ cd ~/.ssh
 $ ls 
 $ cat id_rsa.pub 
複製其中全部內容,添加到賬戶[“SSH 公鑰”頁面](https://coding.net/user/account/setting/keys) 中,公鑰名稱可以隨意起名字。
命令行測試,首次建立鏈接會要求信任主機。
$ ssh -T [email protected]
 // 注意 git.coding.net 接入到 CDN 上所以會解析多個不同的 
host ip The authenticity of host ‘git.coding.net (61.146.73.68)’ can not be established.
 RSA key fingerprint is 98:ab:2b:30:60:00:82:86:bb:85:db:87:22:c4:4f:b1. 
Are you sure you want to continue connecting (yes/no)? yes 
Warning: Permanently added ‘git.coding.net,61.146.73.68’ (RSA) to the list of kn own hosts.

Enter passphrase for key ‘/c/Users/liubiaocong/.ssh/id_rsa’: Coding.net Tips : 
[ Hello Kyle_lyk! You have connected to Coding.net by SSH successfully! ] `

PS : 如果要配置SSH 一定要clone 遵守SSH協議的 git@xxxx地址,不要克隆https://xxxxx的地址。 這真是個大坑!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章