Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSH "Too many authentication failures" error when trying to connect to Raspberry PI from Ubuntu 18.04 [closed]

Tags:

ssh

ubuntu

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.

like image 958
Mirror Mirage Avatar asked Oct 28 '25 05:10

Mirror Mirage


2 Answers

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.

like image 103
Mirror Mirage Avatar answered Oct 30 '25 01:10

Mirror Mirage


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
like image 43
jeb Avatar answered Oct 29 '25 23:10

jeb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!