Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to log all connections to my ssh server. I want to see every ip that connects.
Here's what I have in my firewall script.
/sbin/iptables -A INPUT --protocol tcp --destination-port 22 --match state --state NEW --jump LOG --log-
prefix "Connected to SSH port 22" --log-level 4
I've added a line in my syslog.conf that says:
kern.warning /var/log/iptables.log
Have I done something wrong, I restarted the syslogd and iptables rules, I expected to see my connections to the machine via ssh but my /var/log/iptables.log is empty.
BTW this is running on Fedora Core 9. Thanks again..
Yes, I restarted it. I see in the log where iptables was restarted as well, however I didn't see my new ssh connection. I just want to see all ssh connections. Does the log rule look correct? I moved it to the top prior to any other rules.
I'm moving this to Software, as it's a configuration issue, not a security one. As a side note, logging packets in state NEW won't necessarily show you IPs who have SSH connections open. It's just gonna show you any IP which sent a packet in state NEW to port 22. If you want to log actual connections you should log packets in state ESTABLISHED.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.