Troubleshooting ssh error

Today, I needed to setup ssh on a newly installed Ubuntu machine. Setting up ssh itself was straight forward

But when I tried connecting it from other machine, I got the following error:

Received disconnect from 192.168.1.110 port 22:2: Too many authentication failures 1

When I tried to get help, GenAI focused on Too many authentication part of the error, and gave me suggestions to change server to allow more attempts.

But I had a hunch that was not the case.

So I asked generic debugging tips, and was suggested to use ssh -vvv

Bingo!

Turns out all the publickeys from my client were being offered, and since I had not set the publickey (yet) it was not gonna work.

Based on this, I asked how can I force ssh to use password instead of publickey

Solution : ssh -v -o PreferredAuthentications=password (OK, you can skip -v)

It worked! 🎉

Next either setup publickey, or make password auth default.

Since the machine is temporary, I’m likely to stick with password based authentication. ¯_(ツ)_/¯


  1. IP address changed for this post. ↩︎