0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ubuntu Server 20.04.3 LTS 構築#16 セキュリティ設定8(ファイヤーウォール設定)

Last updated at Posted at 2022-02-20

実施日:2022/02/20

<<今回の内容>>
・ファイヤーウォール設定

ファイヤーウォール設定

・ubuntuサーバーの構築の作業をしていましたが、ファイヤーウォールの設定を今回は行います。

まずは現在の状態を確認します。
sudo ufw status
# 非アクティブ

無効化されているので、有効化します。
sudo ufw enable
# アクティブ

この状態だとincomingがallowになっていますので、denyに変更します。
sudo ufw default deny
# デフォルトのincomingポリシーは'deny'に変更しました
(適用したい内容に基づいて必ずルール変更をしてください)

取り敢えず、ファイヤーウォールの最低限の設定?は完了しました。
必要なポートは順次開放していき、追記するという形にさせて頂きます。

2022/02/22追記

SSH接続をするためにポート(22番)を開放します。

sudo ufw allow 22/tcp

# 状態を確認します。
sudo ufw status
# 状態の結果
To          Action     From
22/tcp      ALLOW      Anywhere
22/tcp(v6)  ALLOW      Anywhere
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?