さくらVPSにDenyHostsをインストール | [k]id東京都世田谷区 ホームページ制作 [k]id

さくらVPSにDenyHostsをインストール

Category WEB Tips,さくらVPSのまとめ Update 2011.05.13

twitterfacebookgoogle+はてなブックマークPocketであとで読むfeedlyで購読

さくらのVPSに不正アクセスを監視し、ログを取るDenyHostsをインストールしました。
その設定のまとめ。。


DenyHosts

先月からお試しでさくらのVPSを借りて色々設定を試しています。
開始して一ヶ月、致命的な動きはみられないのですが、
念のためDenyHostsを導入してみました。

Yumでどうもパッケージが見つからなかったみたいなので、
「EPEL」からパッケージをダウンロードする所からはじめてみます。

epelのリポジトリの追加

# lftp  http://download.fedora.redhat.com/pub/epel/5/x86_64/

lftp download.fedora.redhat.com:/pub/epel/5/x86_64>
と聞いてくるのでその後に続けて


lftp download.fedora.redhat.com:/pub/epel/5/x86_64> get epel-release-5-4.noarch.rpm

xxxxx bytes transferred
で完了したら


lftp download.fedora.redhat.com:/pub/epel/5/x86_64> exit

exitで終了

Yumでインストール

とりあえずYumでインストール


# yum -y install denyhosts

起動と自動起動の設定


# /etc/init.d/denyhosts start
# chkconfig denyhosts on

以上で基本はOK

hosts.denyのチェック

弾かれたアクセスは
”/etc/hosts.deny”に格納される。


# cat /etc/hosts.deny

でチェック。


# DenyHosts: Thu May 1 00:00:00 2011 | sshd: xxx.xxx.xxx.xxx
sshd: xxx.xxx.xxx.xxx

上記のような感じで指定回数を超えたアクセスに関してログを監視しhosts.denyに追加できます。
※指定回数の設定は”/etc/denyhosts.conf ”にあります。

という感じです。

ページトップへ