A
A
Alexander2016-04-12 13:57:12
linux
Alexander, 2016-04-12 13:57:12

How to fix port 22: Connection refused ( ssh )?

[email protected]:~/Numero_Project/poliv/src$ ssh [email protected]
ssh: connect to host ssh.pythonanywhere.com port 22: Connection refused

I googled, reused different methods, but, all without result.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vladimir Kuts, 2016-04-12
@fox_12

This is your outgoing connections to ssh. Check your firewall settings first.
$ ssh -P22 ssh.pythonanywhere.com
The authenticity of host 'ssh.pythonanywhere.com (23.21.200.247)' can't be established.
RSA key fingerprint is SHA256:<some key>.
Are you sure you want to continue connecting (yes/no)? no

K
kresska, 2016-04-12
@kresska

is the ssh port listening? netstat -nlp | grep 22

V
viiy, 2016-04-12
@viiy

There is really nothing to try here.
1) Or you have a firewall. "sudo iptables -L -vn" will help. Regardless of what ufw or other shells answers.
2) Or you have a network such that outgoing connections to the 22nd port are blocked on some kind of equipment (questions to the one who administers the network). You can run "tcpdump -i eth0 -n port ssh or icmp" in one tab. On the second try to connect via ssh. See who sends the same "connection refused".
99% chance this is the problem.

V
Viktor Krasnov, 2018-07-09
@katzo

What if the problem is from Gitlab-CI? Moreover, the task generally works - but if you combine 2 identical commands for 2 site sites in one gitlab-ci, then the second one does not work with this error ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question