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?

ufw で特定のサイトからのアクセスをブロック

Last updated at Posted at 2021-04-13

apache2 のログに次のようなエラーが出ていました。

[Tue Apr 13 04:00:50.206163 2021] [php7:error] [pid 219861] [client 178.33.234.2
05:2193] script '/var/www/html/public_html/wp-login.php' not found or unable to 
stat
[Tue Apr 13 09:32:41.769395 2021] [php7:error] [pid 219879] [client 37.59.221.11
2:44570] script '/var/www/html/public_html/wp-login.php' not found or unable to 
stat

Wordpress への侵入を試みているように思えます。
そこで、このクライアントを ufw でブロックすることにしました。

sudo ufw deny from 178.33.234.205
sudo ufw deny from 37.59.221.112

設定の確認方法

$ sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
Anywhere                   DENY        178.33.234.205            
Anywhere                   DENY        37.59.221.112

登録を取り消すには、まず番号付きで状態を表示

$ sudo ufw status numbered
Status: active

     To                         Action      From
     --                         ------      ----
            
[ 1] Anywhere                   DENY IN     178.33.234.205            
[ 2] Anywhere                   DENY IN     37.59.221.112  

そして、番号を指定して削除

sudo ufw delete 2

確認したバージョン

$ ufw --version
ufw 0.36.2
Copyright 2008-2023 Canonical Ltd.
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?