ellie-commons / sequeler

SQL Client built in Vala
GNU General Public License v3.0
804 stars 66 forks source link

Authentication by public key fails #252

Open pmk1c opened 5 years ago

pmk1c commented 5 years ago

I can't connect to SSH using public key with sequeler. It's the same problem as described in #237. I was now able to confirm the problem with the rpm version 0.6.9 of Fedora. So this is not a Flatpak issue. Here is the debug log:

** (Sequeler:14853): DEBUG: 11:12:28.060: PasswordManager.vala:49: Unable to fetch password in libsecret keyring for com.github.alecaddd.sequeler.09999                                                                                  
** (Sequeler:14853): DEBUG: 11:12:28.060: ConnectionManager.vala:154: Opening tunnel 0x55e8fbb48f70
** (Sequeler:14853): DEBUG: 11:12:28.400: ConnectionManager.vala:218: Authentication methods: publickey
** (Sequeler:14853): DEBUG: 11:12:28.428: ConnectionManager.vala:239: Authentication by public key failed!
** (Sequeler:14853): DEBUG: 11:12:28.429: ConnectionManager.vala:397: closing ssh tunnel from: ConnectionManager.vala:240 0x55e8fbb48f70                                                                                                 
** (Sequeler:14853): DEBUG: 11:12:28.429: ConnectionManager.vala:148: Die Authentifizierung durch den öffentlichen Schlüssel ist fehlgeschlagen!         
Alecaddd commented 5 years ago

From the log, it seems libsecret can't fetch your stored SSH password: Unable to fetch password in libsecret keyring for com.github.alecaddd.sequeler.09999

Do you have an SSH password? Did you save your connection with your SSH password? If you edit your connection, does your SSH password show up in the password field?

prurigro commented 5 years ago

I'm hitting the same issue both with the flatpak and git master. Is there a particular location in the Passwords and Keys app the password should be getting stored? Connecting with the gnome ssh agent via terminal works fine.

pmk1c commented 5 years ago

Ok, so the problem seems to occur when not saving the connection before trying to connect to it.

When I save the connection first, Sequeler is able to find the password. This is a bit weird, since normally I'll try to connect to the server, to make sure I entered everything correct before I save the connection.

prurigro commented 5 years ago

Hmm, saving the connection first doesn't seem to resolve the issue for me.

Alecaddd commented 5 years ago

Mhhh, that's a weird behaviour. Sequeler should recognize that your password is part of the connection form and doesn't need to be fetched from libsecret. Definitely something fishy is going on. I will investigate and write a patch for it. Sorry for the annoying issue

prurigro commented 5 years ago

I'm not sure about pmk1c, but in my case the password for the public key does need to be fetched from libsecret. Now that said, I did try putting the public key password into the connection form and it also failed, but obviously that's less ideal.

DustyLoon commented 5 years ago

I am also experiencing this issue with Elementary, with Sequeler being installed from AppCenter. I can successfully SSH via the terminal to the server, but Sequeler is complaining that "Authentication by public key failed!"

Interestingly, I have to use the IP address of the server to even get this error. If I use the FQDN, I immediately get a "Failed to connect!" error that happens so quickly, it's like it can't do a DNS lookup.

Alecaddd commented 4 years ago

Is this issue still present with the latest version of Sequeler? 0.7.4

DustyLoon commented 4 years ago

I'm still experiencing the exact same issues as in my previous post. Unfortunately, there's no change.

schwemmer commented 4 years ago

I had the same issue (i.e. the connection failed when trying to authenticate with a public key over SSH tunnel). DustyLoon's comment above about using the IP instead of the FQDN solved my issue. Once I changed the server name to the server's IP address, I was able to connect successfully.

schwemmer commented 4 years ago

Turns out I was happy too early... when testing the connection, it now says "successfully connected", but when actually connecting, there is an error "Lost connection to MySQL server at 'reading initial communication packet, system error: 0".

I can connect with SSH via terminal without issues and I can connect to the MySQL database via SSH tunnel with Sequel Pro on a mac using the same settings.

Where can I find the debug info or error log in Sequeler? I installed it via AppCenter and I'm new to Elementary OS.