1. 程式人生 > 實用技巧 >win10系統下配置SSH跳過密碼登入GIT

win10系統下配置SSH跳過密碼登入GIT

當我們使用github等倉庫時,我們有需要ssh認證,所以需要生成它的ssh key。

1、首先你要安裝git工具

下載地址:https://git-scm.com/downloads

2、右鍵滑鼠,選中 “Git Bash here”

3、輸入指令,進入.ssh資料夾

cd ~/.ssh/

如果提示 “No such file or directory”,你可以手動的建立一個 .ssh資料夾即可

mkdir ~/.ssh 

4、生成key

cd ~/.ssh/

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

連續按三次回車,這裡設定的密碼就為空了,並且建立了key。

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

5、用記事本開啟id_rsa.pub,複製裡面的內容新增到你github或者bitbucket ssh設定裡即可

6、測試是否新增成功

github輸入命令:sshgit@github.com

提示:“Hi lsyz0021! You've successfully authenticated, but GitHub does not provide shel l access.”說明新增成功。

參考資料:

https://blog.csdn.net/wilson_hj/article/details/78251117