SSH not logging in


#1

When I try to SSH in I get the following error;

Connecting to 192.168.1.100 port 22
Connection established
Remote version string: SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u3
Local version string: SSH-2.0-JSCH-0.1.53
CheckCiphers: chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
SSH_MSG_KEXINIT sent
SSH_MSG_KEXINIT received
kex: server: curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
kex: server: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
kex: server: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
kex: server: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
kex: server: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
kex: server: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
kex: server: none,zlib@openssh.com
kex: server: none,zlib@openssh.com
kex: server: 
kex: server: 
kex: client: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
kex: client: ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
kex: client: chacha20-poly1305@openssh.com,aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
kex: client: chacha20-poly1305@openssh.com,aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
kex: client: hmac-sha2-256,hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96
kex: client: hmac-sha2-256,hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96
kex: client: zlib@openssh.com,zlib,none
kex: client: zlib@openssh.com,zlib,none
kex: client: 
kex: client: 
kex result: server->client enc: chacha20-poly1305@openssh.com mac: null compr: zlib@openssh.com
kex result: client->server enc: chacha20-poly1305@openssh.com mac: null compr: zlib@openssh.com
SSH_MSG_KEXDH_INIT sent
expecting SSH_MSG_KEXDH_REPLY
Host '192.168.1.100' is known and matches the Ed25519 host key
SSH_MSG_NEWKEYS sent
SSH_MSG_NEWKEYS received
SSH_MSG_SERVICE_REQUEST sent
SSH_MSG_SERVICE_ACCEPT received
Available server authentication methods: publickey,password
Next authentication method: publickey
Authentication succeeded (publickey).
Caught an exception, leaving main loop due to End of IO Stream Read
Disconnecting from 192.168.1.100 port 22
session is down

#2

You need to provide some context.


#3

Unfortunately we need more/special information from the SSH service on our OSMC system for your current issue.

Please, precisely follow these steps to catch debug information for a specific SSH or SFTP problem

  1. If there is not any SSH client working, you need to logging in locally using a USB keyboard, see How to Access the Commandline, use credentials user osmc, password osmc.
    Tip: After you hit “EXIT”, don’t wait for the splash screen and press-and-hold the “Esc”-key on the keyboard until you see the “login:” prompt.
    Skip step 2 and go to step 3 from here.

  2. open an SSH connection to the OSMC device with a working SSH client, use credentials user osmc, password osmc
    (the debug information can only be collected for the NEXT SSH-connection after you logged in. So, prepare your environment/clients, so the problem/issue will occur with the next SSH connection to come. For SFTP-transfer problems it means you first have to connect to the OSMC device with your SFTP-client using appropriate credentials and after that activate the sshd debugging on the OSMC device since file transfer will create new/another SSH-session for the transport)

  3. From now, all following commands have to be invoked on the OSMC device you just logged into with a working SSH client using user/password osmc/osmc:
    sudo systemctl stop sshd
    (this stops the sshd father process but your current session process still keeps living)

  4. sudo /usr/sbin/sshd -D -ddd &>my_sshd_debug.txt
    (this starts a debug sshd which is able to accept one session, only)

  5. reproduce the issue like a failed ssh login or failing sftp transfer
    (the called sshd debug program will automatically terminate when the SSH session is closed; otherwise abort it with ctrl+C after the issue occured)

  6. sudo paste-log my_sshd_debug.txt
    (this transfers the debug information and returns a URL)

  7. sudo systemctl restart sshd
    (restarts the sshd service to normal operation, again)

  8. provide the URL from previous step in this forum topic.

Thx for your time investment, we hope to help you, soon.


#4

http://www.jcraft.com/jsch/ I don’t know this Java SSH2 implementation but last known changelog is 2016 for version 0.1.53 but website offers 0.1.54 … without mentioning anything in the changelog of the zip.


#6

sshd isn’t running when I try to login on my Ubuntu laptop


#7

I’m not sure how this is relevant to being unable to ssh into a Pi running OSMC…

But, since you have Ubuntu, what happens if you ssh into the Pi from the command line of the laptop?

It appears that the ssh client you are using is several years out of date.


#8

That’s what didn’t work. When I try to SSH into OSMC from my Ubuntu 18.04 laptop


#9

What do you get from your laptop running this:

ssh -V

This is what I get from Mint:

brian@gelth ~ $ ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g  1 Mar 2016

#11

@eekfonky Your log shows you’re using a Java-based ssh client solution named “SSH-2.0-JSCH-0.1.53”.
The last update to this stuff is dated 2016 but that is a link to a “0.1.54” version on the website I posted above. For whatever reasons there is no change log for this version 0.1.54.

So, the only interesting thing for us is to see what happens on the OSMC device and is there an issue logged at all or is it a pure ssh client issue on your Ubuntu with this ssh client.

Is there any other machine with a different SSH client you can use to login to the OSMC device and start THERE the sshd logging as described above for the next access try with your Ubuntu?


#17

SSH from ubuntu 18.04
ssh -V

OpenSSH_7.6p1 Ubuntu-4, OpenSSL 1.0.2n  7 Dec 2017 

ssh -vvv osmc@192.168.1.100
OpenSSH_7.6p1 Ubuntu-4, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /home/makeitsocial/.ssh/config
debug1: /home/makeitsocial/.ssh/config line 2: Applying options for *
debug1: /home/makeitsocial/.ssh/config line 189: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "192.168.1.100" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 192.168.1.100 [192.168.1.100] port 22.
debug1: Connection established.
debug1: identity file /home/makeitsocial/.ssh/mis-mac type 0
debug1: key_load_public: No such file or directory
debug1: identity file /home/makeitsocial/.ssh/mis-mac-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Debian-10+deb9u3
debug1: match: OpenSSH_7.4p1 Debian-10+deb9u3 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 192.168.1.100:22 as 'osmc'
debug3: hostkeys_foreach: reading file "/dev/null"
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
debug2: MACs ctos: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
debug2: MACs stoc: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:3ZJvHsLhTkla32ILAYUhwnrD+CtsW9HxrvZlGGBFTFQ
debug3: hostkeys_foreach: reading file "/dev/null"
Warning: Permanently added '192.168.1.100' (ECDSA) to the list of known hosts.
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug2: key: /home/makeitsocial/.ssh/mis-mac (0x55d703c0e350), explicit, agent
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:IGPlN3XrbvJzp6KiKbAq+cldkqG+l6FfxnVbPsnPHaU /home/makeitsocial/.ssh/mis-mac
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
osmc@192.168.1.100's password: 
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 52
debug1: Authentication succeeded (password).
Authenticated to 192.168.1.100 ([192.168.1.100]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: send packet: type 1
packet_write_wait: Connection to 192.168.1.100 port 22: Broken pipe

#19

@eekfonky I interpret your reaction to my request to provide the sshd log that way that you’re not able to login via ssh with any client?

So, do you own a Android smartphone and can try an ssh client like “JuiceSSH” from there? Still interested in the sshd log from the Pi.

If that is also failing your Pi is borked in any way or something in network cuts the connections to the Pi.


#20

All devices fail. Ubuntu laptop. Android phone, Chromebook, Mac and Windows


#21

Well as we assume something is borked on the Pi (e.g. could be filesystem failure).
As you are not able to login from any device my suggestion is to connect a keyboard to the Pi and login via local terminal and then upload logs as a start.

From the terminal you can upload logs via grab-logs -A and also share your ssh config via paste-log /etc/ssh/sshd_config and then sharing the URL’s being displayed. If any of these commands already give you an error please post a picture of it.

Details regarding how to access the command line interface can be found here on our Wiki: https://osmc.tv/wiki/general/accessing-the-command-line/