LoginSignup
14
12

More than 5 years have passed since last update.

自分がやっている Ubuntu サーバーの最低限の設定

Last updated at Posted at 2014-06-09

IPV6 を塞ぐ

/etc/default/ufw を編集します。

IPV6=no

利用しないポートを閉じる

http(s) と ssh のポート(ここでは 37462)以外は閉じる。

sudo ufw default deny
sudo ufw allow http/tcp
sudo ufw allow https/tcp
sudo ufw limit 37462/tcp
sudo ufw enable

ssh サーバーの設定

特定のユーザーが公開鍵認証でのみログインできるようにしてます。
もちろんポートも変えます(port 22 は頻繁にアタックされるので)。

# ポートを変える
Port 37462

# root ログインを禁止
PermitRootLogin no

# パスワード認証を禁止
PasswordAuthentication no

# PAM認証を禁止
UsePAM no

# 特定のユーザーのみログイン可能
AllowUsers user1

ログインユーザーの .ssh/authorized_keys に、接続する PC の公開鍵を追加することをお忘れなく。

残り

帯域制限とかファイルオープン数の上限を上げたりとかかな。
なんかあるかな?

14
12
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
14
12