6
2

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 1 year has passed since last update.

EC2で"Ubuntu 22.04"インスタンスを作成後にログイン出来ない

Posted at

事象

2022/06/10起票
Ubuntu 22.04 LTSインスタンスを起動したが、ログインが出来ない

ユーザ名、使用キーに間違いは無い

ssh -i "rdgw-key.pem" ubuntu@ec2-11-111-111-111.ap-northeast-1.compute.amazonaws.com
Warning: Identity file rdgw-key.pem not accessible: No such file or directory.
The authenticity of host 'ec2-11-111-111-111.ap-northeast-1.compute.amazonaws.com (11.111.111.111)' can't be established.
ECDSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'ec2-11-111-111-111.ap-northeast-1.compute.amazonaws.com,11.111.111.111' (ECDSA) to the list of known hosts.
ubuntu@ec2-11-111-111-111.ap-northeast-1.compute.amazonaws.com: Permission denied (publickey).

原因

Openssh8.8以降ではSSH鍵認証でのRSA認証が無効化されており、作成したUbuntu 22.04 LTSインスタンスではOpenssh8.9p1-3が使用されているため、インスタンス作成時に指定したキーペアのタイプがRSAの場合使用できない。
参考:Jammy Jellyfish Release Notes
参考:https://www.openssh.com/txt/release-8.8

対応

[アクション]->[イメージとテンプレート]->[同様のものを作成]で同じ設定のインスタンスを再作成し、キーペアの設定でキーペアのタイプをED25519で作成しているキーを作成して使用する。
ed25519.png

6
2
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
6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?