📘
【EC2】RHEL9.4にてパスワード認証無しでSSH接続する
はじめに
RHEL9.4のEC2にパスワード認証無しでSSH接続しようとしたが、少しつまづいた。
今回は、RHEL9.4のEC2にパスワード認証無しでSSH接続するための手順について解説する。
環境
- AWS
- RHEL9.4
バージョン
# cat /etc/redhat-release ;date
Red Hat Enterprise Linux release 9.4 (Plow)
#
最初に実施した設定
下記設定を実施したが、SSH接続できず。
1./etc/ssh/sshd_config
の下記設定をNo
→ Yes
にする。
- 設定前
PasswordAuthentication no
- 設定後
PasswordAuthentication yes
2.sshdの再起動
コマンド
systemctl restart sshd
systemctl status sshd
対処
/etc/ssh/sshd_config.d/50-cloud-init.conf
も設定修正する必要有り
※AmazonLinuxでは、この対処は不要とのこと。
1./etc/ssh/sshd_config.d/50-cloud-init.conf
修正
- 設定前
PasswordAuthentication no
- 設定後
PasswordAuthentication yes
2.sshdの再起動
コマンド
systemctl restart sshd
systemctl status sshd
参考
Discussion