ログが溜まってうざいですね。お隣の国からのアタックうざいです。ポート変えた方がいいのかなー。
hosts.allow 更新するスクリプトをcron.daily してるけど、それでも来るもんは来ますね。dailyである必要は全然なくって週一とか月一とかで良さそうですが。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
MASK_TEXT_URL='http://nami.jp/ipv4bycc/mask.txt.gz' | |
WORKDIR=`mktemp -d` | |
cd $WORKDIR | |
wget "$MASK_TEXT_URL" 2> /dev/null > /dev/null | |
if [ $? -ne 0 ]; then | |
exit 1; | |
fi | |
gunzip "$WORKDIR"/mask.txt.gz | |
echo 'sshd: 192.168.1.' > hosts.allow | |
sed -n 's/^JP\t/sshd: /p' "$WORKDIR"/mask.txt >> hosts.allow | |
echo "sshd: ALL" > hosts.deny | |
cp ./hosts.allow ./hosts.deny /etc | |
rm -rf "$WORKDIR" |
あとは、一応Logwatch設定してる。
ログ見るのも大変すね。Rainbowってのがなかなかいい感じです。
Colorize commands output or STDIN using patterns.
他にも似たようなのはいろいろあるみたい。
これとか
0 件のコメント:
コメントを投稿