Question : CentOS 5.3: iptables: remote logins lock outs?

Hello experts,

I am about to implement my firewall remotely...

The tutorial below says that to prevent accidental remote user lock outs, one should should allow LAN SSH connections over port 22.

# Accept tcp packets on destination port 22 (SSH) from private LAN
 iptables -A INPUT -p tcp -s 192.168.0.0/24 --dport 22 -j ACCEPT

However, when I run /usr/sbin/lsof |egrep ESTABLISHED, I get results below:
[root@pggen /]# /usr/sbin/lsof |egrep ESTABLISHED
smbd       5843      root   23u     IPv4     175254    TCP pcgen:microsoft-ds->pcgen1:neod1 (ESTABLISHED)
sshd       9187      root    3u     IPv6     179669      TCP pcgen:ssh->pcgen1:9291 (ESTABLISHED)
sshd       9189     user1    3u     IPv6     179669     TCP pcgen:ssh->pcgen1:9291 (ESTABLISHED)

does this mean that my ssh session is on port 9291?
what is my smbd running on? is neod1 a port number?
also, how do I allow yum? what port?

thx,
Regards,

Answer : CentOS 5.3: iptables: remote logins lock outs?

Nope, not port 9291.  That's where your ssh connection is originating (on pcgen1).

Your established connections are on pcgen:ssh  (ssh is named here, rather than numbered as port 22), and pcgen:microsoft-ds  (again, named here rather than numbered as port 445).  You can view your /etc/services file to compare named services with their expected ports.  You'll see that "neod1" is in there, as port 1047, but I think that's misleading -- you just happen to have connected from port 1047 on pcgen1, you aren't really using neod1 (Sun's NEO Object Request Broker).

As long as you don't block outgoing connections, yum should work just fine.

Random Solutions  
 
programming4us programming4us