2025年10月12日 星期日

設定github ssh key後,在別台電腦也要用ssh key登入

把private key 放到新電腦的~/.ssh/下。Windows就是C:\Users\User\.ssh

在~/.ssh/下建立config如下

Host github.com

  HostName github.com

  User git

  IdentityFile ~/.ssh/YOUR_PRIVATE_KEY

  IdentitiesOnly yes

再用 ssh -T git@github.com 測試,應該要看到下面訊息:

Hi your-username! You've successfully authenticated, but GitHub does not provide shell access.


沒有留言:

張貼留言