simple scripts to provide defence
ban ip from /home/site/access-log/access.log
, the ban rule is in "ban $1" part of the script.
nohup bash accesslog.sh &
ban ip according to the connection numbers noted on netstat.
write value in the script file:
# your public ip
public_ip=
# max connection number
define=
# port
# such as 80 or 443
#port=80
port=
then run it:
nohup bash c.sh &
ban ip according to the tried times noted on ssh login log file.
write value in the script file:
# log file
# centos: /var/log/secure
# debian: /var/log/auth.log
log_file=
# your public ip
public_ip=
# define max tried logined times
define=
then run it:
nohup bash ssh.sh &