LoginSignup
1
0

More than 3 years have passed since last update.

AMIからEC2を立てたときにパスワードログインできない問題

Posted at

問題となったこと

EC2でAMIから複製してインスタンスを作る際、
元々パスワード認証だけでログインしていましたが、ログインできなかったのでその対処法を書いておきます。

ログインする

キーを使って、ec2-userやcentosユーザを使用してログインを行う

sshの設定変更を行う

  • rootになる
sudo su -
  • パスワード認証の設定を変更

AMI作成時に自動的にoffにするらしいです

vi /etc/ssh/sshd_config
==========
PasswordAuthentication no
↓
PasswordAuthentication yes
==========
  • sshdの再起動
systemctl restart sshd

これでsshのパスワードログインができるようになったはずです。

勉強後イメージ

これで結構時間かかってしまった・・・
多分忘れない

1
0
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
1
0