TeamSQL / desktop-app

This repository is currently being used for hosting the official issue & bug tracker of TeamSQL Desktop App.
102 stars 6 forks source link

MySQL - SSH tunnel auth fail #415

Open kk0917 opened 5 years ago

kk0917 commented 5 years ago

Every time I get a error when I try to setup a MySQL connection with the SSH tunnel option. The error message is "Error: All configured authentication methods failed".

Environment:

How Can I setup a connection with the SSH tunnel option?

willemnviljoen commented 5 years ago

Authentication always fails for SSH tunnel

willemnviljoen commented 5 years ago

I've done some additional testing. On the MacOS application, it appears this is related to trying to authenticate with an SSH private key.

As an experiment, I tried setting up password authentication (really not ideal) to my database server. Doing that, SSH tunneling works.

I noticed that even though I selected a key file, the client was not showing the path to that file when next I edited the connection. It could be some problems with hidden files on MacOS preventing the client from reading the key file.

barisozanguler commented 5 years ago

Hi @willemnviljoen

Issue is not related to file path not showing in Edit Connection screen but may cause of some private keys file encoding types and file permissions. Could you check out your authentication logs in "/var/log/auth.log" file from your server and ensure your private key has necessary permissions on your user ?

If you can tell us your server environment(os, os version, ssh config file output), we can try to create same environment because we can't reproduce same issue in our test servers.

Thanks.

e-inv-sangjun-lee commented 5 years ago

Hi @willemnviljoen

I have the same error The error message is Error: All configured authentication methods failed

Environment:

I could access it using command as below ssh -i /Users/xxx/.vagrant/machines/vh/virtualbox/private_key vagrant@127.0.0.1 -p 2222

-rw-------  1 xxx  xxx  1679  9  7  2018 /Users/xxx/.vagrant/machines/vh/virtualbox/private_key

But I couldn't access Test Connection on TeamSQL

Host: 127.0.0.1
Port: 2222
Username: vagrant
Password:
Private Key File: /Users/xxx/.vagrant/machines/vh/virtualbox/private_key

Would you please check?

henrynw commented 5 years ago

Same issue here. Can connect to my ec2 instance using:

ssh -i ~/.privatekeyfile ec2-user@host

But get error when using TeamSQL

mpochron commented 5 years ago

here same issue as wrote by @henrynw

watanabeyu commented 5 years ago

same behavior. please fix 🙇

ghost commented 5 years ago

The team is currently working on this issue, and it will be fixed as soon as possible. Please stay tuned.

cedx commented 5 years ago

I have a similar issue: when using TeamSQL v3, all my MySQL & PostgreSQL connections with SSH tunnel were working perfectly (without having to use a private key file).

When using TeamSQL v4, most of the same MySQL connections with SSH tunnel now fail with this message: Could not create connection to database server. Attempted reconnect 3 times. Giving up. Setting a private key file did not change anything.

I have 4 MySQL connections with SSH tunnel : one of them still succeed to connect to the database server. After investigation, I realized that the working connection communicates with a MariaDB server v10.3.9, and the failing connections communicate with MySQL servers v5.1.73 (three different servers, but using the same software version).

Environment:

EDIT : sorry for the unassignement of @barisozanguler below, it was not voluntary (a bad click on the wrong place). How is it possible?