LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 08-05-2008, 10:25 PM   #1
lucktsm
Member
 
Registered: May 2004
Location: Atlanta, GA USA
Distribution: Redhat ES4, FC4, FC5, slax, ubuntu, knoppix
Posts: 155

Rep: Reputation: 30
Question iptables logging question


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..

Thanks,
Joe
 
Old 08-05-2008, 11:31 PM   #2
hardcorelinux
Member
 
Registered: Jan 2005
Location: India
Distribution: RHEL,CentOS,SUSE,Solaris10
Posts: 183

Rep: Reputation: 31
Did you restart syslog after modifying syslog.conf ?

/etc/init.d/syslog restart
 
Old 08-06-2008, 12:44 AM   #3
lucktsm
Member
 
Registered: May 2004
Location: Atlanta, GA USA
Distribution: Redhat ES4, FC4, FC5, slax, ubuntu, knoppix
Posts: 155

Original Poster
Rep: Reputation: 30
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.
 
Old 08-06-2008, 08:23 AM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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.
 
Old 08-06-2008, 10:30 PM   #5
lucktsm
Member
 
Registered: May 2004
Location: Atlanta, GA USA
Distribution: Redhat ES4, FC4, FC5, slax, ubuntu, knoppix
Posts: 155

Original Poster
Rep: Reputation: 30
Ok thanks for the heads up and sorry for the wrong forum...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables logging hemi_426 Linux - Server 39 05-01-2008 05:11 AM
iptables logging saavik Linux - Networking 5 09-13-2007 01:49 AM
iptables not logging anything~ deeptii Linux - Networking 11 05-31-2006 02:35 AM
iptables logging question cassiusclay Linux - Networking 8 06-21-2004 03:51 PM
I need help on iptables logging FunkFlex Linux - Security 1 01-17-2003 11:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration