7
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ubuntu 16.04LTSで、sshログインできない対策

Last updated at Posted at 2016-08-21

Ubuntu 16.04LTSをいれたら、sshの公開鍵認証でログインできなくなった。
/var/log/auth.log を確認したところ、下記のエラーが出力されている。
OpenSSH-7.0でssh-dssは無効化されたようだ。

Aug 20 23:36:26 ubuntu sshd[25608]: userauth_pubkey: key type ssh-dss not in PubkeyAcceptedKeyTypes [preauth]

参考: http://www.openssh.com/txt/release-7.0

プロトコルの脆弱性を把握できてなかったことに衝撃を受けつつ調べるとこの情報を見つける。
参考: http://security.stackexchange.com/questions/112802/why-openssh-deprecated-dsa-keys

ssh-dssを再有効化するのはありえないので、ECDSAへの移行を決心する。ssh-keygenで、鍵ペアを生成。

% ssh-keygen -t ecdsa -b 384 -C 'sumikawa@XXX'
Generating public/private ecdsa key pair.
Enter file in which to save the key (/Users/sumikawa/.ssh/id_ecdsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/sumikawa/.ssh/id_ecdsa.
Your public key has been saved in /Users/sumikawa/.ssh/id_ecdsa.pub.
The key fingerprint is:
SHA256:XXX sumikawa@XXX
The key's randomart image is:
+---[ECDSA 384]---+
(snip)
+----[SHA256]-----+

これで無事sshログインできるようになりました。

ついでにgithubとbitbucketのSSH keysも更新。どっちもECDSAを受け付けてくれた。
iPadのpromptアプリは未対応だった。残念。

7
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?