ssh: 接続に時間がかかる現象を解決

新しいPCに移って、sshでの接続にやたら時間がかかる(10秒とか)ので、ーvオプションを付けて実行すると、


debug1: Authentications that can continue: publickey,gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
No credentials cache found
のようなメッセージが出ている。publickeyでの認証より前にgssapi-with-micという方式(初耳)による認証をトライし、それで時間がかかっている。

調査の結果、.ssh/config に次のような記述を追加すればよいことが判明。


Host *
GSSAPIAuthentication no