Assalam u Alaikum
i have problem in my linux SSH server peoplez try to login to server through ssh. How i want to block those attempts? if some buddy tries for 3rd time wrong password the linux block its IP like that. ... . .
can any budy u guyz help me out in this regard
Thnx
How to secure the SSH login @ my Linux box
-
- Lance Naik
- Posts: 27
- Joined: Thu Nov 09, 2006 10:47 pm
- Location: Karachi
- Contact:
How to secure the SSH login @ my Linux box
Muhammad Amir Iqbal
WireOnn Network
http://www.wireonn.com
Contact # +92-345-2089773
Register Linux User #435086
WireOnn Network
http://www.wireonn.com
Contact # +92-345-2089773
Register Linux User #435086
Re: How to secure the SSH login @ my Linux box
if you want to block the ip after the third attempt, you can run a script that does "tail -F /var/log/secure.log" (or whatever the log file with the ssh attempts is called), and when it matches against an ip three times in, say, a minute, it can run "iptables -A INPUT -s ip.add.re.ss -j REJECT" or something.
it might help to age out old entries from the input chain every so often, too.
i could write it for you, but you need the exercise. use your brain!
it might help to age out old entries from the input chain every so often, too.
i could write it for you, but you need the exercise. use your brain!
-
- Lance Naik
- Posts: 27
- Joined: Thu Nov 09, 2006 10:47 pm
- Location: Karachi
- Contact:
Thanx lambada
thnx for u r quick reply i understand that u sey but can i do this in /etc/ssh/sshd.conf file and what abt. the knocking script what u suggest
Muhammad Amir Iqbal
WireOnn Network
http://www.wireonn.com
Contact # +92-345-2089773
Register Linux User #435086
WireOnn Network
http://www.wireonn.com
Contact # +92-345-2089773
Register Linux User #435086
check out this link to block ssh brute forcing attacks
http://www.csc.liv.ac.uk/~greg/sshdfilter/
http://www.csc.liv.ac.uk/~greg/sshdfilter/
Re: Thanx lambada
no, you can't.hyperlinux wrote:but can i do this in /etc/ssh/sshd.conf file
the one you write yourself. don't want to write one? use the package saad khan suggested.what abt. the knocking script what u suggest
you'll be a better person if you try to write one yourself, though.