Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Authentication failure for vs-code-remote X11 setup #10

Closed
rahulkd opened this issue Apr 24, 2020 · 7 comments
Closed

Authentication failure for vs-code-remote X11 setup #10

rahulkd opened this issue Apr 24, 2020 · 7 comments

Comments

@rahulkd
Copy link

rahulkd commented Apr 24, 2020

I am trying to display remote Linux gui application in vs code installed in local windows pc. But When I installed remote-x11 in remote Linux server, I found the following error in the logs.

  • setting up display for remote "ssh-remote".
  • Connecting to SSH Rahul@10.100.56.98 port 22
  • Error : All Configured authentication methods failed.

Initially I have generated a keygen pair(public/private key) which is stored in ~/.ssh/ folder
ssh-keygen -t rsa -b 4096

Note : I am able to connect the remote-ssh to the server successfully.

@joelspadin
Copy link
Owner

That usually means SSH wasn't able to log in using the provided key. Things to check:

  1. Did you run ssh-keygen on your local Windows PC? You need to have the %USERPROFILE%\.ssh\id_rsa file on your local PC. (You can also put it in a different location if you change your remoteX11.SSH.privateKey setting to point to it.)
  2. Did you add your public key to your server's ~/.ssh/authorized_keys file? If not, open id_rsa.pub on your local PC, copy the contents, open ~/.ssh/authorized_keys on the remote server, and paste it on a new line.

@RexBarker
Copy link

RexBarker commented Apr 25, 2020

Hi @ChaosinaCan ,
Thanks for your work towards the extension improvements. I now seem to connect to the machine, with my specific hostname and port assignment. However, now it is not picking up the authorization correctly. I use a private-public key setup, with the key defined in ~/.ssh/id_rsa. For my connections, I use the ssh-agent to support automated login (by initiating the agent with ssh-add ~/.ssh/id_rsa). This seems to work fine with the "Remote SSH" extension from Microsoft, and my command line logins.
However, it seems the "Remote X11" add-in still misses the local agent, and it doesn't prompt me for the password. The response I get is:

Setting up display for remote "ssh-remote". Connecting to SSH rexbarker@linuxBoxFoo.rexbarker.org port 1234 Error: Cannot parse privateKey: Encrypted private OpenSSH key detected, but no passphrase given

This is similar to another reported issue below:
Issue 4: authentication with private key

@joelspadin
Copy link
Owner

@RexBarker My extension didn't support using ssh-agent, but as of version 1.3.0 it now does. See the readme for instructions on enabling it. If you run into any issues, please either re-open #4 or open a new issue, as I don't believe your issue is related to the one @rahulkd has. Thanks!

@rahulkd
Copy link
Author

rahulkd commented Apr 29, 2020

Hi @ChaosinaCan
Sorry for my late response and thanks for your quick feedback.
I ran ssh-keygen on my local windows PC but I didn't add the public key to the server location as you have mentioned.
I will do that and let you know.

@rahulkd
Copy link
Author

rahulkd commented Apr 30, 2020

Hi @ChaosinaCan
Thanks for your support. It worked.
I truly appreciate your effort and keep up the good work.

@joelspadin
Copy link
Owner

Great. Thanks!

@oramirite
Copy link

I'm getting this error all of a sudden after reinstalling Arch on two different servers that I used to have this working with. It's also still working with a third server that I haven't reinstalled yet.

I hope I'm not missing something stupid. I'm connecting to my server from my Windows PC using SSH remote, and then I'm installing the X11 (SSH) version of the plugin to the server after connecting. I have Xming running on my Windows PC. I definitely have my Windows computer's public key in the authorized_keys file on my server, since this is how I'm able to connect via SSH in the first place. The logs aren't showing any helpful information other than "All Configured authentication methods failed."

When connecting to this server using Putty and enabling X11 forwarding there, it works fine.

I'm really stumped. I had this working perfectly before. Why isn't it finding my authorized key? Could there be an SSH fingerprint stuck somewhere from my previous install? I've cleared all of that out in my default known_hosts file in order to get my SSH connections working again anyway. I'm just puzzled as to why authorization is failing if I've already used SSH remote to properly authenticate my key to connect in the first place.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants