Skip to main content
1 of 5
Kev
  • 1.8k
  • 4
  • 27
  • 48

Can't ssh into new CentOS install after port change

I have two machines on a network, one Windows with PuTTY, and one CentOS 6.4 with sshd and with the default SELinux still enabled.

I installed the policycore-python package so I could use semanage, then followed these directions.

Step 4 looked like it's the new default, since it was already set up that way.

Step 5 worked and I assume the stuff about ~/.ssh/config is for setting up your ssh client on another machine, so it doesn't apply (I can do something similar in PuTTY.)

Step 6 I figured the shortest and most applicable thing was the third option, so I ran:

iptables -A INPUT -p tcp --dport 2345 --syn -m limit --limit 1/m --limit-burst 3 -j ACCEPT
iptables -A INPUT -p tcp --dport 2345 --syn -j DROP

Just in case I did service iptables restart after that.

That's where I stopped for now. At this point, I can do ssh -p 2345 localhost on the CentOS box and log in fine, but I can no longer PuTTY into the CentOS box. I put the right IP and port 2345 in the connection window, but upon attempting to connect, I get a black screen with a solid green cursor, which, after a few seconds, gives a GUI popup:

---------------------------
PuTTY Fatal Error
---------------------------
Network error: Connection timed out
---------------------------
OK   
---------------------------

My router is even set up to forward port 2345 to 2345 on the CentOS box's IP, but I'm guessing that doesn't affect things here at this point, since I'm connecting from within the network.

Kev
  • 1.8k
  • 4
  • 27
  • 48