Centos SSH Access- Changed the SSH port now I cant access server

centosremote-accessssh

I think I just screwed up – I changed my VPS's SSH access port from 5252 to 48001, now I cannot login.

I changed it in the IPtables(/etc/sysconfig/iptables), I literally just changed the port number from 5252 to 48001, and then restarted my server. now, I also cannot access via port 5252…(obviously because I changed it, but I tried anyways)

How can I get into the VPS again? Other ports that are open are 80 and 21…Is there a way I can login from there with my root details?

Thank you

Best Answer

Unless you have some sort of out of band console access to the VPS then you'll have to contact your provider and get them to fix it for you.

What you should have done (you don't mention it) is change the Port directive in /etc/ssh/sshd_config as well as the port to allow in iptables.

You should have changed the port as above and restarted sshd (it doesn't drop your current connection) then added a line to the iptables configuration to allow the new port and restart iptables. Test the new connection works then remove the old connection details with the new connection and restart the services.

Related Topic