2

When I enabled the -v option, I saw that my SSH client was trying out all the available SSH keys and then dying with the message "Too many authentication failures"

I tried removing the entries from ~/.ssh/known_hosts.

But it still wouldn't budge. Raspberry PI is fine, and I am able to connect via Putty from Windows 10 machine.

Mirror Mirage
  • 1,287
  • 1
  • 8
  • 7
  • If someone is facing this error with VNC-Viewer or a VNC-Server session, this answer might help. https://stackoverflow.com/a/61919651/4388776 – Keet Sugathadasa May 20 '20 at 17:57

2 Answers2

2

The only thing which worked was this.

I edited ~/.ssh/config file and added an entry

Host 192.168.1.123
PreferredAuthentications=password

This forces my Ubuntu SSH client to use password authentication, and doesn't try all the SSH keys available locally and then die. Note: 192.168.1.123 is my Raspberry PI IP address

If you don't know what your PI IP address is ... :) Install FING app on your mobile and do a network scan, it will show you all devices on your network.

Mirror Mirage
  • 1,287
  • 1
  • 8
  • 7
2

The known_host file isn't related to your problem.
It's seems to be the problem, that your agent knows too many keys.

You can try it with

ssh -o IdentityAgent=none -i private_key_file_for_raspberry ...

You can add this to your config file, too.

HOST raspi42
   hostname raspberry.myhome
   user pi
   IdentityAgent none
   IdentityFile private_key_file_for_raspberry
jeb
  • 78,592
  • 17
  • 171
  • 225