DaHai8
Posts: 55
Joined: Fri Jul 31, 2015 9:21 am

SSH throwing java.io.IOException

Sat Sep 26, 2015 11:21 am

Today I am trying to log into by RPi (Raspbian OS) remotely using SSH and it is throwing the following error:
Connection Failed
java.io.IOException: End of IO Stream Read
Do you want to retry?
Retrying doesn't work.
It fails on Windows using PuTTY and Android using JuiceSSH.

I have another remote RPi (also Raspbian) that I can log into with SSH successfully.

Both were recently 'apt-get update' / 'apt-get upgrade' about a week ago. And both had stunnel4 installed and running at that time as well.

Here is the Connection information shown in JuiceSSH on my Android phone when I try to connect

Code: Select all

Connecting to xxx.xxx.xxx.xxxx port xxxx
Connection established
Remote version string: SSH-2.0-OpenSSH_6.Op1 Debian-4+deb7u2
Local version string: SSH-2.0-JuiceSSH
CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,
aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
CheckKexes: diffie-hellman-group14-sha1
SSH_MSG_KEXINIT sent
Disconnecting from xxx.xxx.xxx.xxx port xxxx
Any help, clues, or things to check would be greatly appreciated. But like I said, its remote (very remote) and I have no way to lay my hands on it.

Thanks.

DaHai8
Posts: 55
Joined: Fri Jul 31, 2015 9:21 am

Re: SSH throwing java.io.IOException

Sat Sep 26, 2015 1:34 pm

I forgot that I also install Google 2 Step Authentication on both of these Raspberry Pi's.

Code: Select all

apt-get install libpam-google-authenticator
But again, one RPi fails on SSH login attempt, and the other one does not.

Hope someone can help.

DaHai8
Posts: 55
Joined: Fri Jul 31, 2015 9:21 am

Re: SSH throwing java.io.IOException

Sun Sep 27, 2015 7:49 am

Ok, here's an update: It's fixed, but I'm not sure how it got broke to begin with...

I had the RPi rebooted and then it no longer threw IO Exceptions on login. So perhaps something is cache got horked up and the reboot cleared it. But then...

Google authenticator (GA) would no longer accept any of the verification codes from my Google Authenticator app. So I used up one of the 'emergency' back-up codes and that let me in. This led me to believe that the date/time was off because GA is based on accurate dates and times. And it was! It was 3 days off ... in the past! Sept 24, and the time was also off by 5 hours early.

So I reset the date and time and also looked at the ntp configuration. That's when I noticed that there were some specific ntp server entries I had put in there a long time ago - before I found that ntp is already setup and configured and you don't need to to that. So perhaps one of those servers had a glitch and the RPi read a bogus date/time. I dunno. Not really sure how all that works.

Anyway, like I said. Rebooting fixes the Java IO Exception. Removing the specific ntp config entries I had previously added and resetting the date/time fixed the GA problem.

But, again, I'm not sure how all this got messed up in the first place

User avatar
DougieLawson
Posts: 39164
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: SSH throwing java.io.IOException

Sun Sep 27, 2015 7:57 am

You should have

Code: Select all

server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst
that way you'll always get a stratum 2 or 3 server that's online and sync'd to a valid time source.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

kabjar
Posts: 2
Joined: Fri Oct 02, 2015 12:26 pm
Location: Czech Republic

Re: SSH throwing java.io.IOException

Fri Oct 02, 2015 1:21 pm

Hi,

I'm just facing the same error on my RPi B+ :cry: . Not able to connect using Putty and JuiceSSH as well...

It's 2 days old installation of RPi (Raspbian OS) and I haven't set up any specific ntp servers.

I'm not able to find out more infos cause I'm far away, but will try find more after rebooting device...

Any suggestions are very appreciated.

Thanks.

#kabjar

kabjar
Posts: 2
Joined: Fri Oct 02, 2015 12:26 pm
Location: Czech Republic

Re: SSH throwing java.io.IOException

Mon Oct 05, 2015 11:36 am

This is update of my Java.io.IOException trouble.

After hard-rebooting (power off, power on) my RPi it seemed that everything return into normal state for a while, but next day and several hours later the whole situation repeated again. Unfortunately while I was able to connect over SSH and see log files etc., I found nothing suspicious...

Just after another OFF/ON my filesystem probably became corrupted because RPi is booting with read-only root filesystem producing a lot of errors in dmesg and so on. I tried fsck, but with no luck (some files are abnormally big and it is not possible to remove/move them), so right now I have to reinstall whole device again and I'm just thinking about switching into read-only root filesystem to prevent another possible filesystem/SD card corruption.

Have to say that I have very bad experience with long-therm stability of RPi in 24/7 mode :-(

#kabjar

Return to “Troubleshooting”