SSH is not working for remote hosts

June 29, 2013 58.4k views
I can login to SSH with web interface but it does not work from my Mac when I type ssh root@IP I have not setup SSH Keys. I wish to login with password. Looks like I am missing something obvious. I had used other competing cloud services (not sure if I can mention it here) and I always could login. Thanks
18 Answers
What's the output of ssh -vvv root@IP?
  • I get this:

    OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
    debug1: Reading configuration data /etc/ssh_config
    debug1: /etc/ssh_config line 20: Applying options for *
    debug1: /etc/ssh_config line 102: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to 104.236.191.115 [104.236.191.115] port 22.
    debug1: connect to address 104.236.191.115 port 22: Operation timed out
    ssh: connect to host 104.236.191.115 port 22: Operation timed out
    

    I've added my local machine's public ssh to digital ocean. I'm also using Cloud66.

  • Ah, yeah so I just had to add a rule in the firewall settings for Cloud66

  • Better yet, I can open a temporary connection through Cloud66 to increase security.



users-iMac:~ user$ ssh -vvv root@37.139.5.243
OpenSSH_5.6p1, OpenSSL 0.9.8x 10 May 2012
debug1: Reading configuration data /Users/user/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 37.139.5.243 [37.139.5.243] port 22.
debug1: Connection established.
debug1: identity file /Users/user/.ssh/id_rsa type -1
debug1: identity file /Users/user/.ssh/id_rsa-cert type -1
debug1: identity file /Users/user/.ssh/id_dsa type -1
debug1: identity file /Users/user/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.1p1 Debian-4
debug1: match: OpenSSH_6.1p1 Debian-4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 37.139.5.243
users-iMac:~ user$



Thank You
Hmm. Log in to your droplet through the Web Console and run the following command:

cat /etc/ssh/sshd_config | curl -F 'sprunge=
Now I can't login in SSH via web.

Also I can't ping


6 194.44.212.254 (194.44.212.254) 23.490 ms 20.449 ms 22.968 ms
7 dialup-212.162.19.73.frankfurt1.mik.net (212.162.19.73) 71.332 ms 47.522 ms *
8 * * ae-4-90.edge5.frankfurt1.level3.net (4.69.154.201) 45.528 ms
9 xe-10-2-1.fra44.ip4.tinet.net (141.136.102.73) 42.327 ms 42.783 ms
intelq-tinet (4.68.63.58) 43.027 ms
10 xe-0-0-0.ams12.ip4.tinet.net (89.149.186.234) 49.974 ms
xe-11-1-1.ams12.ip4.tinet.net (141.136.109.170) 52.345 ms
xe-2-0-0.ams12.ip4.tinet.net (89.149.186.246) 49.909 ms
11 serverstack-gw.ip4.tinet.net (141.136.96.18) 64.936 ms 54.717 ms 67.328 ms
12 * * *
13 * * *
14 * * *
15 * * *
16 * * *
17 * *

I have not ran anything on server yet. Just installed did
apt-get install golang
users-iMac:~ user$ ping 37.139.5.243
PING 37.139.5.243 (37.139.5.243): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
I did Power Cycles and it works again
here is sprunge

http://sprunge.us/cLbb
You have to uncomment (remove the #) the following line and restart ssh:

#PasswordAuthentication yes

save the file and restart sshd: "service ssh restart"

You should now be able to login using your password.
Thank you for helping but it does not work

http://sprunge.us/AEcU

I also did reboot after ssh restart has not worked for me


users-iMac:~ user$ ssh -vvv root@37.139.5.243
OpenSSH_5.6p1, OpenSSL 0.9.8x 10 May 2012
debug1: Reading configuration data /Users/user/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 37.139.5.243 [37.139.5.243] port 22.
debug1: Connection established.
debug1: identity file /Users/user/.ssh/id_rsa type -1
debug1: identity file /Users/user/.ssh/id_rsa-cert type -1
debug1: identity file /Users/user/.ssh/id_dsa type -1
debug1: identity file /Users/user/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.1p1 Debian-4
debug1: match: OpenSSH_6.1p1 Debian-4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 37.139.5.243
Did you edit /etc/ssh/sshd_config on your droplet? The file you pasted is ssh_config.
Yes. I edited file in droplet.
sprunged it
http://sprunge.us/AEcU

Restarted ssh
It does not helped

Then I did reboot



The file you sprunged is /etc/ssh/ssh_config, make sure you're editing /etc/ssh/sshd_config
My bad but nothing changed after I edited sshd_config

I did ssh restart and then I also did reboot

Here is sshd_config

http://sprunge.us/gJEF

I have not setup any ssh key with digital ocean

I just created 1 droplet
Please run the following commands:

rm /etc/ssh/ssh_host*
dpkg-reconfigure openssh-server

Restart ssh and you should be able to login.
Thank You! I am able to login now!

I faced the same issue today. Tried all the steps mentioned here, but no success. Eventually, did a power cycle, and was able to login. The only change I had made to my droplet before this problem occurred, was adding a crontab entry to start my service at reboot. Is there a better way known to solve this SSH issue?

I am facing the same issue since yesterday and still no resolution, I tried the above steps and here where I stand, Restart the ssh didn't work, webconsole works but not remote. Here's the output:

OpenSSH7.2p2, LibreSSL 2.4.1
debug1: Reading configuration data /etc/ssh/ssh
config
debug1: /etc/ssh/sshconfig line 20: Applying options for *
debug2: resolving "139.59.112.218" port 22
debug2: ssh
connectdirect: needpriv 0
debug1: Connecting to 139.59.112.218 [139.59.112.218] port 22.
debug1: Connection established.
debug1: key
loadpublic: No such file or directory
debug1: identity file /Users/Raj/.ssh/id
rsa type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /Users/Raj/.ssh/idrsa-cert type -1
debug1: key
loadpublic: No such file or directory
debug1: identity file /Users/Raj/.ssh/id
dsa type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /Users/Raj/.ssh/iddsa-cert type -1
debug1: key
loadpublic: No such file or directory
debug1: identity file /Users/Raj/.ssh/id
ecdsa type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /Users/Raj/.ssh/idecdsa-cert type -1
debug1: key
loadpublic: No such file or directory
debug1: identity file /Users/Raj/.ssh/id
ed25519 type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /Users/Raj/.ssh/ided25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH
7.2
sshexchangeidentification: read: Connection reset by peer

Have another answer? Share your knowledge.