8

I am having trouble connecting to a remote server with X2GO using a DSA key. Connecting works fine over SSH, but when I try to connect with X2GO, it goes immediately to the username/password box and doesn't want to use the private key I specify in the options. If I select "Try auto login" it appears to try to connect and then I get the following error:

No public key matched
Access denied. Authentication that can continue: publickey

It was working previously, but I reinstalled the client OS and since then I am unable to connect. I copied all of the SSH keys over from the previous installation.

I also tried deleting my ~/.ssh/known_hosts file and adding the key to ssh-agent with no success, but the key is definitely added correctly:

$ ssh-add -l
1024 b9:3d:e5:ef:48:ea:fc:c6:6e:45:89:b5:35:e7:58:39 server.com_dsa (DSA)

Note, if I enable password authentication on the server, I can connect fine, however I would like to use publickey. Any ideas how I can connect with public key authentication?

Mike
  • 669
  • 2
  • 9
  • 25

4 Answers4

3

Encountered the same problem from Windows could not connect to remote linux client with SSH Key. Even Auto Login with Pageant running from PuTTY directly or running the included X2GO Pageant would not use my Windows PPK formatted ssh key. I had to use my linux formated style ssh key. Once I used that in the X2GO client config, I was able to successfully connect to my linux client again, using the more secure ssh tunnel instead of password authentication.

Turn PuTTY Formatted SSH into Linux Formatted SSH:

Copy your PPK to your linux machine Run the following commands, and copy that output file back to your windows box

chmod 400 ppkfile

ssh-keygen -i -f ppkfile > linuxstylekey

user373310
  • 31
  • 4
  • This wasn't my problem since I don't use Windows for anything. Your command seems a bit messed up though mixing chmod with ssh-keygen. You can also export the keys directly in Putty, see: https://stackoverflow.com/questions/2224066/how-to-convert-ssh-keypairs-generated-using-puttygenwindows-into-key-pairs-use – Mike Oct 03 '17 at 21:55
  • that was just a formatting error on my part, I have cleaned that up. Sven I am sorry I thought my answer was different because the answer from kfmfe04 and lsm did not resolve my problem because I was selecting the correct key from windows, but it was in PuTTY format, it was not until I selected the linux openssl formatted key that my connection issue was resolved. – user373310 Oct 05 '17 at 19:12
  • It's easier to just use puttygen.exe `Conversions->Export OpenSSH` included in x2go: https://stackoverflow.com/a/2224204/125507 – endolith Dec 07 '18 at 04:37
1

These answers didn't work for me.

This answer resolved my issue: x2go passphrase prompt then authentication fail

The solution is to create an old-style rsa key like this.

ssh-keygen -m PEM -t rsa -b 4096

Also, the above linked answer didn't work for me with pageant.exe (it gave a wrong key format error). But that was fine, since I could specify the above generated .ppk file via the X2Go sessions tab "Use RSA/DSA key for ssh connection:".

This all was a bit tricky to troubleshoot, since no relevant errors were given by the X2Go client.

richyz
  • 11
  • 2
0

Which server/client combination are you trying?

When I use a OSX client against an Ubuntu server, everything works fine. Just do the typical copying of public keys to ~/.ssh/authorized_keys on the server.

When I use a Windows client against an Ubuntu server, it works, but is flaky/buggy.

For the latter, you need to follow the instructions here. Essentially, you need to run:

C:\Program Files\x2goclient>ssh-keygen.exe -t dsa

Then get the key into ~/.ssh/authorized_keys on the server.

You also need to pay attention to specifying the corresponding private key file when configuring a specific connection on the windows client.

In the present Windows client, it will prompt me, unnecessarily, to Enter passphrase to decrypt a key three times, pause a bit, and then let me into the server. Everything seems to work fine until I log out, after which the client hangs/crashes.

This client is build 4.0.0.3 on Windows 8.

slm
  • 7,355
  • 16
  • 54
  • 72
kfmfe04
  • 111
  • 4
  • It turns out, on the server, I was using `%h/.ssh/authorized_keys2` instead of `%h/.ssh/authorized_keys` in my `sshd_config` file, so I was adding the keys to the wrong file. However, I can now only connect if I previously add the key to ssh-agent and not by simply specifying the key in the x2go client options. – Mike Apr 29 '13 at 16:18
0

I know its a very old question, but I would like to share how to connect with x2go when using public key AND password.

If you are able to login from ssh without any special setup (except for the public key, of course), then just tick the box Try auto login ... and leave the Use RSA/DSA ... box empty.

connecting to x2go with publickey and password

Checklist:

  • x2go server is up and running
  • Your sshd_config contains: AuthenticationMethods publickey,password (or similar)
  • You added your client's public key (i.e. id_rsa.pub) into your server's authorized_keys file.
  • You are able to connect using ssh command (Authenticated with partial success message is displayed before entering password).
  • You applied the settings as shown in the above image.
lepe
  • 468
  • 1
  • 6
  • 23