sequeler icon indicating copy to clipboard operation
sequeler copied to clipboard

Authentication by public key fails

Open pmk1c opened this issue 6 years ago • 11 comments

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!         

pmk1c avatar Apr 24 '19 09:04 pmk1c

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?

Alecaddd avatar Apr 24 '19 16:04 Alecaddd

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.

prurigro avatar Apr 25 '19 17:04 prurigro

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.

pmk1c avatar May 03 '19 15:05 pmk1c

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

prurigro avatar May 03 '19 20:05 prurigro

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

Alecaddd avatar May 06 '19 04:05 Alecaddd

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.

prurigro avatar May 10 '19 16:05 prurigro

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.

DustyLoon avatar Jul 23 '19 07:07 DustyLoon

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

Alecaddd avatar Apr 03 '20 04:04 Alecaddd

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

DustyLoon avatar Apr 05 '20 02:04 DustyLoon

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 avatar Apr 30 '20 16:04 schwemmer

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.

schwemmer avatar Apr 30 '20 16:04 schwemmer