google fonts

2019年3月18日 星期一

GitLab一直擋我SSH Key到底該設定哪裡?

這邊專指windows environment。

C:\Users\{{使用者帳號}}\.ssh\config

首先得新增一個.ssh的folder在你的使用者帳號底下,然後再新增一個沒有副檔名的config檔,內容如下:

  
Host YOUR_HOST_OR_IP
  Preferredauthentications publickey
  HostName YOUR_HOST_OR_IP
  IdentityFile ~/.ssh/id_rsa_file
  User YOUR_NAME

Host YOUR_HOST_OR_IP_2
  Preferredauthentications publickey
  HostName YOUR_HOST_OR_IP_2
  IdentityFile ~/.ssh/id_rsa_file_2
  User YOUR_NAME

※注意,其實IdentityFile放置的位置跟你現在config的位置相同。

目前這樣我就能解sourceTree吃不到SSH Key的問題,如果有其他狀況可留言給我= =