ssh into database is working, but not from apps.

ssh into database is working, but not from apps.

I bumped over the weekend into an interesting issue. All of a sudden MongoDB Compass and mingo.io didn’t let me ssh into my remote MongoDB database. Tools like Studio 3T or JetBrains Datagrip worked w/o any issues.

I had no issue using ssh with a monogsh from my terminal to successfully connect to my remote database.

The only thing I remember is that I upgraded my server from Ubuntu 20.04 LTS to 22.04 LTS. I haven’t found the root cause but what works for me is adding:

PubkeyAcceptedKeyTypes=+ssh-rsa

into /etc/ssh/sshd_conf

The simple:

PubKeyAuthentication yes

seems not to be enough any longer, if you want to authenticate with a private key and ssh under all circumstances.

I am happy that I found a solution, but I am still a bit puzzled why only a few apps were affected, probably depending on how they are building up their ssh connection string.