Github の複数アカウントで ssh -T git@github.com をしたら同じ名前が出てきた時の対処法

複数Github のアカウントがうまく設定できてるかどうか確認するためによくやる方法として

$ ssh -T git@github.com

$ ssh -T git@github-private.com

があります。

大抵の場合、

$ ssh -T git@github.com
Warning: Permanently added 'github.com, XXX.XX.XXX.XXX' (RSA) to the list of known hosts.
Hi tanjoin! You've successfully authenticated, but Github does not provide shell access.

$ ssh -T git@github-private.com
Warning: Permanently added 'github.com, XXX.XX.XXX.XXX' (RSA) to the list of known hosts.
Hi makietan! You've successfully authenticated, but Github does not provide shell access.

とかになるがすごくたまーに

$ ssh -T git@github.com
Warning: Permanently added 'github.com, XXX.XX.XXX.XXX' (RSA) to the list of known hosts.
Hi tanjoin! You've successfully authenticated, but Github does not provide shell access.

$ ssh -T git@github-private.com
Warning: Permanently added 'github.com, XXX.XX.XXX.XXX' (RSA) to the list of known hosts.
Hi tanjoin! You've successfully authenticated, but Github does not provide shell access.

となってしまう時がある。
なんだ俺のSSH次元歪んでんじゃん!ヒャッハー!!
みたいなポジティブな人はそういないのでなんとかして修正したい

で、解決方法

$ ssh-add -D
All identities removed.

これでいろいろ消える

$ ssh-add -l
The agent has no identities.

正直やらなくていいコマンドだった


とりあえずSSH関連のキャッシュを消せばうまくいくっぽいです