iT邦幫忙

0

[Git] authentication with ssh key

  • 分享至 

  • twitterImage
  •  

Step1: 建立ssh公鑰及私鑰

安裝git 傳送門,打開git bash執行下列指令

ssh-keygen -t rsa -b 4096 -C "your_git_email@example.com"

過程中會問你預存位置及要不要額外密碼,省麻煩可以都直接enter跳過
以Windows為例,預設會出現在 C:\Users\User\.ssh 底下

  1. id_rsa => 私鑰
  2. id_rsa.pub => 公鑰

Step2: 設定公鑰給github

https://ithelp.ithome.com.tw/upload/images/20220205/20146276hUU5SLzR1c.png
把步驟一產生出來的的第二個檔案內容複製貼上即可

Step3: 匯入私鑰轉換成sourcetree使用的ppk檔案

https://ithelp.ithome.com.tw/upload/images/20220205/2014627621xRN2Zeaw.png

https://ithelp.ithome.com.tw/upload/images/20220205/20146276mvIYfSYMOY.png
匯入成功之後就可以按下Save private key,他會問你是不加密碼儲存嗎? 省麻煩就選是產生ppk檔案

Step4: 設定轉換好的私鑰給sourcetree

  • 確定Option裡面有設定好ssh
    https://ithelp.ithome.com.tw/upload/images/20220205/201462769epqlARm3R.png
  • 並且確定Pageant有執行
    https://ithelp.ithome.com.tw/upload/images/20220205/20146276aP3zWKSBS3.png
  • 最後選擇add key,然後把第三步產生出來的ppk檔案加進去即可

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言