LoginSignup
1
1

SSH接続する前にすべき設定

Posted at

はじめに

 SSH接続のセキュリティー対策対策をまとめました。

これだけはやっておこう!

ポート変更

 適当なポートに変更します。

- #Port = 22
+ Port 43822

接続できるユーザーの制限

 以下の記述を追記します。

+ AllowUsers 許可するユーザー名

rootユーザーのログイン禁止

 優先度一番高いやつ。

- PermitRootLogin yes
+ PermitRootLogin no

公開鍵認証を有効に、パスワード認証を無効にする

- PubkeyAuthentication no
- PasswordAuthentication yes
+ PubkeyAuthentication yes
+ PasswordAuthentication no

不要ならX11フォワーディングも無効にする

- X11Forwarding yes
+ X11Forwarding no

おわりに

 これで安心してSSH接続できますね。

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