2

my work has a Raspberry Pi that we use to run our test scripts, and we have been trying, and failing, to SSH into the pi. We have a Raspberry Pi 3, and are even on the same network, so SSH should be easy. We have tried both key authentication as well as password, but we only ever get back

ssh_exchange_identification: read: Connection reset by Peer

We even manually copied the keys over to the pi to ensure we could connect, and still no joy. There is no block list, and all the settings are on to allow for SSH. The only thing that I can think of left is that the date and time for the Pi are wrong, and I have been unable to correct them. Would incorrect date/time settings on the Pi prevent us from SSHing in?

2 Answers 2

5

I have never heard that ssh depends on date and time. I have just tested it by setting:

rpi ~$ sudo date --set='2000-01-01'
Sat  1 Jan 00:00:00 GMT 2000
rpi ~$

I have no problem to ssh into the RasPi. You should start ssh with the verbose option -v:

remote ~$ ssh -v pi@raspberrypi

This should show you more details why ssh reset the connection. On the RasPi you may also have a look at:

rpi ~$ journalctl --unit=ssh.service

what sshd tells you why it reset the connection.

0

Yes. Before I fixed the time problem, my PIs were 2018 but the year is 2020.

https://www.raspberrypi.org/forums/viewtopic.php?t=178763

After I fixed the time issue using part of this article, I was able to ssh from host computer to all raspberry pi nodes in cluster.

2
  • 1
    Can you please explain why ssh needs a synchronized time to connect to a remote device? What is the maximal allowed time difference for connecting?
    – Ingo
    Commented Feb 16, 2020 at 19:42
  • I do not know why, but if I were to make an educated guess -- it has to do with the keys used to ensure an encrypted connection. I am going to do some research on my end, but it must have something to do with validation for a "secure connection" :)
    – Dan
    Commented Feb 17, 2020 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.