Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
You want to deny ssh action to everyone except 192.168.0.100, refused attempts get logged (which must a big log file make.)
Presumably you can figure out how to rig policy deny, and accept incoming ssh connections by IP?
This leaves adding a log entry... which is just the same as the accept incoming, except it jumps to a log instead.
I think it is important that you understand your firewall. It is also good discipline to describe what you hope to acheive in normal language instead of trying to duplicate the effect from another application.
Thanks for the wise advice but at least i should get a mail when some one tries to ssh me...Can i achieve this through iptables or is there any other method except tcp-wrappers,port sentry and tripwire?
... should appear after the -j ACCEPT entry for ssh from that one allowed IP. Since you have a default drop policy <raised eyebrow> you don't need an explicit DROP rule here.
[*]I don't do this myself, but I modified a rule to log portscans. http://www.newartisans.com/blog_file...h.iptables.php
... caveat: these guys don't seem to use default DROP policies. Sad sad sad... you will always forget something: -P DROP catches it.
To be clear about the other things: Port Sentry is deprecated and should not be used anymore. Use something like Snort or Prelude if you want IDS capabilities or else something "simple" like PSAD could do. tripwire is a filesystem integrity checker like Aide, Samhain, Osiris and such has nothing to do with checking ports. Wrt to SSH it would be good to harden your setup, read the sticky Failed SSH login attempts thread and implement one of the solutions. The idea to e-mail an alert on tripping a port is nice if your part of the 'net doesn't receive any port probing but it is not an efficient or scalable solution.
Hi frns,
Thanks for the valuable suggestions.What i want was that i should get the alert through mail when the hacker attacks or even tries to attack my Server.So again in brief tell me how to prevent server from being hacked and get alerts.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.