0
0

More than 3 years have passed since last update.

AWS EC2 nginx SSHポート番号変更の方法

Posted at

AWS EC2 nginxサーバーのSSHポート変更してみた

やること
①AWSセキュリティグループ(インバウンドルール変更)
②/etc/ssh/sshd_configのport変更
③sshd再起動
④configファイルのポート変更

①AWSセキュリティグループ(インバウンドルール変更)

EC2→セキュリティグループ→任意のセキュリティグループを選択→インバウンドルールの変更
スクリーンショット 2021-01-18 17.41.17.png
▷青枠のところに任意のSSHポートを記入
▷真ん中の枠にはIPアドレス関連の情報を記入
▷右の枠には説明を記入

②/etc/ssh/sshd_configのport変更

①で設定した任意のSSHポートを記入

#Port 22
Port 任意のもの

③sshd再起動

sudo systemctl restart sshd

④configファイルのポート変更

port22→port任意のものに変更

終わり

久しぶりのqiita投稿は初歩的なセキュリティでしたー
最近セキュリティで痛い目見たから根本から見直しだ!!!!

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