Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect with SSH certificate #2361

Closed
buzzia2001 opened this issue Nov 22, 2024 · 15 comments · Fixed by #2386
Closed

Unable to connect with SSH certificate #2361

buzzia2001 opened this issue Nov 22, 2024 · 15 comments · Fixed by #2386
Assignees
Labels
bug A confirmed issue when something isn't working as intended

Comments

@buzzia2001
Copy link

Hi everyone,
I'm trying to setting up vs code in order to connect to my I whith certificate. Now a days I'm still using password, but I want to try using certificate. My version of code4i is 2.13.6 and my vs code is 1.95.3 on MacOS.
When I setup up my connectio I choose my idrsa.pub and when I click on save it seems to be fine, but when I try to connect there is this error "config.privateKeyPath does not exist at given fs path"
Can anyone help me?
Thank you a lot for your amazing job

Andrea

@sebjulliand
Copy link
Collaborator

Hi @buzzia2001 ,
there may be bug when the Login editor saved the private key path.

As a workaround, open your user settings as JSON, look for your connection settings, and then put the privateKeyPath like this:
image

Save and try to connect.

Also, make sure you put the path to your private key (presumably id_rsa or id_ed25519), and not the .pub file which is the public key.

@buzzia2001
Copy link
Author

Ciao @sebjulliand,
editing my conf works fine.
As you can see there were some trash on my config file... As you said I think it's a bug of login editor

image

@sebjulliand
Copy link
Collaborator

Yep, this will corrected in the future.

@sebjulliand sebjulliand linked a pull request Nov 22, 2024 that will close this issue
1 task
@sebjulliand sebjulliand self-assigned this Nov 22, 2024
@sebjulliand sebjulliand added the bug A confirmed issue when something isn't working as intended label Nov 22, 2024
@buzzia2001
Copy link
Author

@sebjulliand thank you for your support

@sebjulliand
Copy link
Collaborator

@sebjulliand thank you for your support

Anytime 😉

@jwoehr
Copy link
Contributor

jwoehr commented Nov 26, 2024

There definitely is a bug in creating a connection lately. I just tried for a while and had to edit the settings in json.

@worksofliam
Copy link
Contributor

@jwoehr you mean in regards to using a certificate?

We have a PR in the works. Just needs a little more testing.

@jwoehr
Copy link
Contributor

jwoehr commented Nov 26, 2024

It's that it doesn't correctly create the entry in the settings.json file.
Or at least it did not do so for me today @worksofliam

@worksofliam
Copy link
Contributor

@jwoehr if you create a new connection and attempt to connect, it won't save unless it connects successfully.

@jwoehr
Copy link
Contributor

jwoehr commented Nov 26, 2024

It didn't seem to save the path to the key file correctly. It just put the file name in with no path.

@jwoehr
Copy link
Contributor

jwoehr commented Nov 27, 2024

@worksofliam here's what's happening today when I try to create a new IBM i connection.

When I get to the "private key" part, my Ubuntu-like distro opens a Gnome requester and I choose the key from my home ~/.ssh directory. In the VSCode dialog, I only see the name of the key, no path attached.

Then I try to connect and get this error:
Screenshot from 2024-11-26 20-29-24

If I look at ~/.config/Code/Users/settings.json I find:

{
            "name": "SomeHost",
            "host": "192.168.1.99",
            "port": 22,
            "username": "MYPROFILE"
            "privateKeyPath": "undefined"
        }

If I manually thereafter edit the file to add the privateKeyPath, all works as expected.

@jwoehr
Copy link
Contributor

jwoehr commented Nov 27, 2024

@worksofliam Just had another one this morning ... customer who couldn't get private key login working, this time on Windows. Same thing: Browse for private key, shows correct in the settings dialog, but ends up with "privateKeyPath": "undefined". Edited settings.json manually and it works.

@sebjulliand
Copy link
Collaborator

@jwoehr this is known bug. The Choose file button from the connection editor used to return the full path to the selected file, but since what I suspect to be a recent VS Code update, the full path isn't returned anymore. Instead you either get a fake path or undefined.

We'll try to release a fix at some point, but for now the only workaround is to edit the settings manually and set the path to the private key manually 😑

@jwoehr
Copy link
Contributor

jwoehr commented Nov 27, 2024

Je vous en remercie ... just wanted to make sure we are clear on what users are experiencing.

@sebjulliand
Copy link
Collaborator

Je vous en remercie ... just wanted to make sure we are clear on what users are experiencing.

Avec plaisir ! Yup, users are experiencing an unexpected annoying surprise feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A confirmed issue when something isn't working as intended
Projects
None yet
4 participants