2
3

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 5 years have passed since last update.

denyhosts

Last updated at Posted at 2013-12-11

sshで接続が鬱陶しいIPを/etc/deny.hostsに書き込むデーモン。

logwatchを見ていたら以下の様なアクセスログがあります。

 sshd:
    Authentication Failures:
       root (112.4.190.41): 1700 Time(s)
       root (60.169.78.71): 1263 Time(s)
       unknown (202.90.40.156): 663 Time(s)
       root (static-195-228-132-188.sadecehosting.net): 183 Time(s)
       root (202.90.40.156): 180 Time(s)
       unknown (112.4.190.41): 173 Time(s)
       root (61.147.116.20): 83 Time(s)
       root (221.204.231.137): 75 Time(s)
       root (61.147.116.21): 75 Time(s)
       unknown (vm-118-138-241-200.erc.monash.edu.au): 73 Time(s)
       unknown (static-195-228-132-188.sadecehosting.net): 70 Time(s)
       ...

鍵認証を必須としているため大丈夫ですが、しかし気持ち悪いので入れとく。

インストール
sudo apt-get install denyhosts
アクセス拒否したくないIPリスト
sudo sh -c "cat > /var/lib/denyhosts/allowed-hosts <<EOF
192.168.
127.
EOF"
sudo /etc/init.d/denyhosts restart
2
3
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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?