문제

I'm trying to ssh into github using a different private key than my original one. It seems like the ssh request is somehow cached, because no matter what I do when I call ssh -T git@github.com, it says

Hi [wrong-user] You've successfully authenticated...

I've tried doing a variety of things:

  • Removing github.user and user.email from my .gitconfig
  • Removing my id_rsa completely
  • Using ssh -i with different identity files including an invalid identity file
  • Updating my .ssh/config with

Host github.com
    HostName github.com
    User git
    IdentityFile /path/to/private/key/for/right-user

No matter what it seems like I always get a response from github logging in as the wrong user.

Is there something else I can do to tell github to use a different user / private key to authenticate?

도움이 되었습니까?

해결책

You can check your cached ssh keys with ssh-add -l.

You can delete all cached keys with ssh-add -D.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top