Linux – Cannot log in to server after SSH port change

linuxportssh

I followed step one of this guide to change the SSH port of my server: http://www.linux.com/archive/articles/61061

Now, when I try to log in to it again by typing

    ssh -p 1234 user@my-server

I get the message

    Connection closed by xxx.xxx.xxx.xxx

xxx being the IP address of my server.
Not using the -p option of using any other port results in the answer

    ssh: connect to host my-server.com port xxx: Connection refused

How can I connect to it again? It's a Debian machine, in case that matters.

Best Answer

(As Kurt just mentioned) After having changed your default port in sshd_config, did you follow up by ensuring iptables was allowing inbound connections to your new port?

Related Topic