Ssh failed establishing socket connection

Hi there, i have just replaced my pi0 for pi 3, I can connect fine through my pc via SSH but when i try to connect from my App on phone (Simple SSH) it just refuses connection. - Actually says “connection failed”
Could not connec to pi3 (thats the host name)
Reason: failed establhing socket connection

I have rebuilt it from scratched the same thing is happening.

Plugged my Pi0 back in and i can connect perfectly fine…

On my Pi3 i have only installed SSH/Cron/Tranmissiong and just installed flexget didn work before that either.

any ideas? is there a block for non PC connections on Pi3?

very confused…

Things if it helps:

https://paste.osmc.tv/vofoxemade

osmc@pi3:~$ sudo netstat -tulnp | grep :22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 368/sshd
tcp6 0 0 :::22 :::* LISTEN 368/sshd

osmc@pi3:~$ ifconfig
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC> mtu 1500
ether b8:27:eb:71:71:82 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 34 bytes 4382 (4.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 34 bytes 4382 (4.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC> mtu 1500
inet 192.168.0.203 netmask 255.255.255.0 broadcast 192.168.0.255
ether b8:27:eb:24:24:d7 txqueuelen 1000 (Ethernet)
RX packets 33915 bytes 27769275 (26.4 MiB)
RX errors 0 dropped 1859 overruns 0 frame 0
TX packets 16440 bytes 2712628 (2.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

osmc@pi3:~$ ifconfig
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC> mtu 1500
ether b8:27:eb:71:71:82 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 34 bytes 4382 (4.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 34 bytes 4382 (4.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC> mtu 1500
inet 192.168.0.203 netmask 255.255.255.0 broadcast 192.168.0.255
ether b8:27:eb:24:24:d7 txqueuelen 1000 (Ethernet)
RX packets 34005 bytes 27778708 (26.4 MiB)
RX errors 0 dropped 1871 overruns 0 frame 0
TX packets 16493 bytes 2724900 (2.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

osmc@pi3:~$ cat /etc/ssh/sshd_config | paste-log
https://paste.osmc.tv/vofoxemade
osmc@pi3:~$ sudo netstat -tulnp | grep :22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 368/sshd
tcp6 0 0 :::22 :::* LISTEN 368/sshd
osmc@pi3:~$ ifconfig
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC> mtu 1500
ether b8:27:eb:71:71:82 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 34 bytes 4382 (4.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 34 bytes 4382 (4.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC> mtu 1500
inet 192.168.0.203 netmask 255.255.255.0 broadcast 192.168.0.255
ether b8:27:eb:24:24:d7 txqueuelen 1000 (Ethernet)
RX packets 34970 bytes 27893611 (26.6 MiB)
RX errors 0 dropped 2010 overruns 0 frame 0
TX packets 16859 bytes 2810435 (2.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Please help :slight_smile: ----------------

Have you tried connecting by IP address (192.168.0.203) instead of host name? Can you ping the IP address?

thanks for the suggestion. Yes have tried that (and again just now) incase… Same thing.

It’s likely an issue with cipher negotiation. At this point, we’d need more logging from the ssh server on the Pi, plus the SSH client on your phone.

On the Pi, use the following to get the log:

sudo journalctl -t sshd

thanks for suggestion:

here is the output…

osmc@pi3:~$ sudo journalctl -t sshd
– Logs begin at Thu 2016-11-03 17:16:42 GMT, end at Sat 2019-04-27 08:14:07 BST. –
Apr 26 23:17:02 pi3 sshd[343]: /etc/ssh/sshd_config line 18: Deprecated option KeyRegenerationInterval
Apr 26 23:17:02 pi3 sshd[343]: /etc/ssh/sshd_config line 19: Deprecated option ServerKeyBits
Apr 26 23:17:02 pi3 sshd[343]: /etc/ssh/sshd_config line 30: Deprecated option RSAAuthentication
Apr 26 23:17:02 pi3 sshd[343]: /etc/ssh/sshd_config line 42: Deprecated option RhostsRSAAuthentication
Apr 26 23:17:02 pi3 sshd[374]: /etc/ssh/sshd_config line 18: Deprecated option KeyRegenerationInterval
Apr 26 23:17:02 pi3 sshd[374]: /etc/ssh/sshd_config line 19: Deprecated option ServerKeyBits
Apr 26 23:17:02 pi3 sshd[374]: /etc/ssh/sshd_config line 30: Deprecated option RSAAuthentication
Apr 26 23:17:02 pi3 sshd[374]: /etc/ssh/sshd_config line 42: Deprecated option RhostsRSAAuthentication
Apr 26 23:17:02 pi3 sshd[374]: Server listening on 0.0.0.0 port 22.
Apr 26 23:17:02 pi3 sshd[374]: Server listening on :: port 22.
Apr 27 00:46:24 pi3 sshd[831]: rexec line 18: Deprecated option KeyRegenerationInterval
Apr 27 00:46:24 pi3 sshd[831]: rexec line 19: Deprecated option ServerKeyBits
Apr 27 00:46:24 pi3 sshd[831]: rexec line 30: Deprecated option RSAAuthentication
Apr 27 00:46:24 pi3 sshd[831]: rexec line 42: Deprecated option RhostsRSAAuthentication
Apr 27 00:46:24 pi3 sshd[831]: reprocess config line 30: Deprecated option RSAAuthentication
Apr 27 00:46:24 pi3 sshd[831]: reprocess config line 42: Deprecated option RhostsRSAAuthentication
Apr 27 00:46:24 pi3 sshd[831]: Accepted password for osmc from 192.168.0.127 port 63907 ssh2
Apr 27 00:46:24 pi3 sshd[831]: pam_unix(sshd:session): session opened for user osmc by (uid=0)
Apr 27 00:46:50 pi3 sshd[857]: rexec line 18: Deprecated option KeyRegenerationInterval
Apr 27 00:46:50 pi3 sshd[857]: rexec line 19: Deprecated option ServerKeyBits
Apr 27 00:46:50 pi3 sshd[857]: rexec line 30: Deprecated option RSAAuthentication
Apr 27 00:46:50 pi3 sshd[857]: rexec line 42: Deprecated option RhostsRSAAuthentication
Apr 27 00:46:50 pi3 sshd[857]: Unable to negotiate with 192.168.0.197 port 63480: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1 [preauth]
Apr 27 00:49:11 pi3 sshd[831]: pam_unix(sshd:session): session closed for user osmc
Apr 27 08:13:41 pi3 sshd[3204]: rexec line 18: Deprecated option KeyRegenerationInterval
Apr 27 08:13:41 pi3 sshd[3204]: rexec line 19: Deprecated option ServerKeyBits
Apr 27 08:13:41 pi3 sshd[3204]: rexec line 30: Deprecated option RSAAuthentication
Apr 27 08:13:41 pi3 sshd[3204]: rexec line 42: Deprecated option RhostsRSAAuthentication
Apr 27 08:13:42 pi3 sshd[3204]: reprocess config line 30: Deprecated option RSAAuthentication
Apr 27 08:13:42 pi3 sshd[3204]: reprocess config line 42: Deprecated option RhostsRSAAuthentication
Apr 27 08:13:42 pi3 sshd[3204]: Accepted password for osmc from 192.168.0.127 port 52086 ssh2
Apr 27 08:13:42 pi3 sshd[3204]: pam_unix(sshd:session): session opened for user osmc by (uid=0)
osmc@pi3:~$

As @nabsltd seems your simple SSH is not supporting the latest cyphers

You have two options either:

  1. enable the old one on OSMC (not recommended for security) OpenSSH: Legacy Options
  2. Use an SSH APP that supports the latest key exchange protocols

I can recommend JuiceSSH on Android.

ConnectBot is also a good Android app.

Thanks for your help all, did these change with the newest OSMC update? Im on IOS but will see if i can find the apps on that form. one thing i loved about Simple SSH is the fact you can have scripts which are stored which u can then run against a host. things like checking on any thing in transmission. it would then show the results on screen without actaully having to type / actually sign in.

For me, nothing changed… JuiceSSH still works fine. Could mean your SimpleSSH might need an upgrade.

In my experience, on Android, every SSH app I’ve tried had this ability.

No, they were introduced already quite sometime ago but might have holded due to a customized sshd_conf