Connecting to MongoDB via SSH Tunnel works when using password, but doesn't when using identify file on Ubuntu


I’m trying to setup SSH Tunnel in MongoDB Compass in order to connect to MongoDB located on my server. I successfully made a connection to it without SSH tunnel and by using SSH with password authentication. When trying to connect using SSH with Identity File, Compass shows error All configured authentication methods failed and the connection isn’t established. Connecting normally to the server using SSH works without issues.

I’m using MongoDB Compass 1.32.6 on Pop!_OS (Ubuntu) 22.04. The server uses Ubuntu Server 20.04.

What can I do to solve this issue?

Fixed it, just had to add
PubkeyAcceptedKeyTypes ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512
to /etc/ssh/sshd_config

Hope this helps somebody.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.