Linux login
From MohidWiki
Revision as of 18:54, 13 December 2007 by 192.168.20.177 (talk)
How to configure the linux login in order to be safer.
Change the port sshd listens to
Uncomment and change the line containing port 22 to port 2996
> vim /etc/ssh/sshd_config sshd_config> port 2996
This one really helps a lot!
Is there a way to check on ip lists and ban recursive ips failing to login?
The best way that I have found for doing this is this:
> sudo iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW -m recent --set --name SSH > sudo iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 8 --rttl --name SSH -j DROP
The downside to this is that every time you reboot or restart iptables you have to do this again. The easiest thing to do is put it in a bash script. There is a great article @ TechBlog - How to: Block brute force attacks with iptables.