hello everyone.i do have my a VPS (debian 7) with a public IP address and I would like to protect it. I would like to have access only to SSH (public/private keys), openVPN, services that are requested from the VPS itself, such as sending emails, DNS, access to Internet. All users that connect to the system through OpenVPN then have full access to it and to the Internet.
My current setup is:
Code:
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -X
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 1194 -j ACCEPT
iptables -P INPUT DROP
iptables -A OUTPUT -p tcp -m tcp --sport 22 -j ACCEPT
iptables -A OUTPUT -p tcp -m tcp --sport 1194 -j ACCEPT
iptables -P OUTPUT DROP
I would like to blacklist all IPs that attack me or try to scan me. Whoever has 3 failed ssh attempts then get blacklisted for 24 hours. Is it possible to help me please?