issue connecting with ssh

I am having issue where I can't SSH to my server. I was having a look at some logs on the server, finished and just closed the connection. As soon as I tried connecting again I got the message: ssh: connect to host SERVERIP port 22: Connection refused.

Here is the debug log:

XXXXX:~ XXXXXX$ ssh -vvvv XXXXX@serverip
OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to SERVERIP [SERVERIP] port 22.
debug1: connect to address SERVERIP port 22: Connection refused
ssh: connect to host SERVERIP port 22: Connection refused

I can see it refers to line 21 but nothing was changed in the config file, any idea what is causing this?

1 Answer

Connection refused is a generic socket/service related error, it is typically shown when establishing a socket where the remote endpoint has no listener on the desired port.

In this case the remote server must not have the ssh daemon running, so does not have anything listening on port 22 (presumably), or a highly unlikely possibility is that the ssh daemon itself is having issues.

So make sure the ssh daemon is running (and functioning properly) on remote host you are trying to connect to.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like