プロジェクト

全般

プロフィール

Cygwin64 ssh

OpenSSH

OpenSSH 7.1

問題と解決

Cygwinをアップデートしたらsshの公開鍵認証がスキップされパスワード認証になってしまった

まとめ

  • 恒久的解決
    DSA鍵はOpenSSH 7から無効とされたので(脆弱)、 RSA鍵 ECDSA等に変更する
  • 暫定解決
    ~/.ssh/configに次を追記
    PubkeyAcceptedKeyTypes=+ssh-dss
    • 注意)+で指定しないとssh-dss限定になってしまうため、他の鍵種類を使うとはねられてパスワード認証になってしまいます。

詳細

cygwinをアップデートした直後、sshでリモートマシンに接続したら、公開鍵認証ではなくパスワードを要求されました。
cygwinのアップデートで~/.sshのパーミッションが変わる?ということもなく、
-vオプションを付けて実行し、関係しそうなメッセージを抜粋したのが次です。

debug1: identity file /home/toru/.ssh/id_dsa type 2
debug1: key_load_public: No such file or directory
  :
debug1: Skipping ssh-dss key /home/toru/.ssh/id_dsa for not in PubkeyAcceptedKeyTypes
  :
debug1: Next authentication method: password

どうやら使用しているid_dsaが気に入らない模様です。このメッセージで検索するといくつか類似事象が見つかりました。

https://cygwin.com/ml/cygwin/2015-08/msg00249.html
http://superuser.com/questions/965241/permission-denied-publickey-after-update-of-cygwin

cygwinのアップデートでOpenSSHが6.8から7.1に上がったことで、id_dsaがデフォルトで無効になったようです。OpenSSHのサイトに記述がありました。
http://www.openssh.com/legacy.html

OpenSSH 7.0 and greater similarly disables the ssh-dss (DSA) public key algorithm. It too is weak and we recommend against its use.


8年以上前に更新