cweijan / vscode-database-client

Database Client For Visual Studio Code
https://database-client.com
MIT License
2.46k stars 280 forks source link

[BUG] Using a SSH tunnel to connect to mysql/mariadb: All configured authentication methods failed #1208

Closed Offerel closed 2 months ago

Offerel commented 2 months ago

When i enable the SSH Tunnel, to connect to a MariaDB/MySQL server gives me a error message: Connection error! All configured authentication methods failed. However, when i open a SSH Tunnel manually on the shell (Windows/Linux) with ssh -L 3306:localhost:3306 username@serverhost, i can connect fine. When im using the shell to open the tunnel, it uses the available ssh-agent without any issues. The server uses elliptic curve keys.

Pluginversion: 7.5.5 2024-7-11

cweijan commented 2 months ago

Please try enabling the CBC algorithm.

image image

Offerel commented 2 months ago

I have tried that, but it didn't help. The specified algo, key and ciphers are also supported by the server, regardless of whether I additionally activate the cbc keys or not. I have now extracted the private key and saved it as a file. A connection works immediately. I therefore assume that the plugin probably cannot find the key agent. This is the same, not matter, if i use VSCode on Linux or Windows. On Windows i have tried using KeeAgent (Plugin for KeePass) and PAgent from putty suite. On Linux KeePassXC.

Update: using ssh-add -l gives me on both system a list of the available keys. So this basically works just fine.

Offerel commented 2 months ago

I have retested Linux (since im at home now). There the connection via SSH is working. But the issue on Windows remains. Is there something, i can try to simulate the connection to the SSH Agent?

cweijan commented 2 months ago

Thanks feedback. I didn't notice that you were using Windows. Windows environment does not support ssh agent.

Offerel commented 2 months ago

I'm using both. But good to know. In this case, i will open the SSH tunnel via shell and ssh-agent on WIndows and using this existing tunnel to connect the db.

cweijan commented 2 months ago

Another option is to connect via a configuration private key.

image

Offerel commented 2 months ago

yes, this works, but i don't want to save my private key at the windows workstation. But maybe im using a different key, specially for this purpose. Many thx for the hint.