ssh: connect to host 45.xx.xx.xx port 22: Connection refused

i am getting error like this

3 Replies

Is sshd running and configured correctly on 45.xx.xx.xx?

-- sw

yes it's running and now it showing like this
OpenSSH_9.0p1 Debian-1+b2, OpenSSL 3.0.7 1 Nov 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 45.xx.xx [45.xx.xx.xx] port 22.

yes it's running and now it showing like this
OpenSSH_9.0p1 Debian-1+b2, OpenSSL 3.0.7 1 Nov 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 45.xx.xx [45.xx.xx.xx] port 22.

None of this means that sshd is configured correctly. It just means that the configuration you presented doesn't have any syntax errors.

Are you using a known login/password? Like this:

ssh 45.xx.xx.xx -l <login name>

If you don't specify a login name, ssh will assume $LOGNAME at the system where the session was initiated:

ssh 45.xx.xx.xx

is the same as

ssh 45.xx.xx.xx -l $LOGNAME

Is port 22 open in your firewall? Do you have certificates configured? Are they configured correctly?

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct