-
Notifications
You must be signed in to change notification settings - Fork 267
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
Unsupported key format for openssh format (Mac Mojave) #391
Comments
Why not set passphrase in |
When i gen a rsa with ssh-keygen , also got the problem:
sftp.json:
|
work fine with password |
Extension Logs - required
|
Hi there, I'm experiencing this same issue now that the ssh key is being generated on mojave using openssh. logs:
|
Extension Logs - required
|
The same problem. Here's my logs:
|
Sorry @liximomo here is the full log.
|
@sydneyjean Have you set a passphrase to your key file? |
@liximomo yeah, I tried it with:
With all attempts I shut down and restarted vscode. From my research online I haven't found a way to generate an ssh key on macOS mojave without OPENSSH format. 🤔 |
@cjcox17 @fanshengshuai @biu0w0 @sydneyjean We need to wait for the upstream library to support this. Here is some workarounds:
|
I am experiencing the same issue on Mac Mojave 10.14.1. I have a key generated without passcode. We need a solution that must work with existing key. I think this extension needs changes to support the format to work with Mac Mojave |
The same issue is happening on Windows machine as well. Please fix this issue or provide a workaround. |
This workaround solved the issue for me
|
@sydneyjean Thanks that did resolve the issue. I think this should be in the setup instructions as a workaround. |
+1 same problem |
https://kmagen2.wordpress.com/2019/01/04/begin-openssh-private-key-begin-rsa-private-key/ |
Should now be supported in sftp v1.9.0. |
@KietLuuu What version of puttygen are you using, please? On puttygen v0.67 I have here, your very promising suggestion: Following down the rabbit hole of your supplied link gets me here, but with the same result. I can't create an updated (RFC4716 compliant) version of my old private key. |
When a ssh key is generated with or without a passphrase, it results in an unsupported key format error.
The key works fine for SSH and other applications.
Key Header:
-----BEGIN OPENSSH PRIVATE KEY-----
Steps to reproduce the behavior:
ssh-keygen -t rsa -b 4096
NOTE and WORKAROUND: The key also will not be read by puttygen to convert the key to a .ppk if the key has a passphrase. Another error, "Unsupported Cipher" is returned when importing the key. However, if the passphrase is removed from that key via
ssh-keygen -p id_rsa
then the key is loaded fine by puttygen and can be exported to a .ppk that works fine in vscode-sftp.
Expected behavior
I expected the plugin to accept the format of the key as it does when I use the same command in either WSL(Windows Sub-systems for Linux) or in Ubuntu/Fedora. (Used VSCode on all of these platforms).
Macbook Pro:
OS: MacOS Mojave 10.14.1
VSCode: 1.28.2
Extension Version: 1.7.3
SSH Version: OpenSSH_7.8p1, LibreSSL 2.7.3
Extension Log(Some private data has been omitted):
{"remotePath":"/","uploadOnSave":true,"downloadOnOpen":false,"ignore":[".vscode",".git",".DS_Store","vendor/*","node_modules"],"concurrency":4,"protocol":"sftp","connectTimeout":10000,"interactiveAuth":false,"secure":false,"passive":false,"remoteTimeOffsetInHours":0,"port":22,"host":"","username":"******","privateKeyPath":"/Users/cjcox17/.ssh/sftp_test_key","passphrase":"******"} [error] Error: Cannot parse privateKey: Unsupported key format at Client.connect (/Users/cjcox17/.vscode/extensions/liximomo.sftp-1.7.3/node_modules/ssh2/lib/client.js:231:13) at Promise (/Users/cjcox17/.vscode/extensions/liximomo.sftp-1.7.3/out/src/core/remote-client/sshClient.js:231:22) at new Promise (<anonymous>) at SSHClient.<anonymous> (/Users/cjcox17/.vscode/extensions/liximomo.sftp-1.7.3/out/src/core/remote-client/sshClient.js:209:20) at Generator.next (<anonymous>) at /Users/cjcox17/.vscode/extensions/liximomo.sftp-1.7.3/out/src/core/remote-client/sshClient.js:7:71 at new Promise (<anonymous>) at __awaiter (/Users/cjcox17/.vscode/extensions/liximomo.sftp-1.7.3/out/src/core/remote-client/sshClient.js:3:12) at SSHClient._connectSSHClient (/Users/cjcox17/.vscode/extensions/liximomo.sftp-1.7.3/out/src/core/remote-client/sshClient.js:202:16) at SSHClient.<anonymous> (/Users/cjcox17/.vscode/extensions/liximomo.sftp-1.7.3/out/src/core/remote-client/sshClient.js:74:24) at Generator.next (<anonymous>) at fulfilled (/Users/cjcox17/.vscode/extensions/liximomo.sftp-1.7.3/out/src/core/remote-client/sshClient.js:4:58) at <anonymous>
The text was updated successfully, but these errors were encountered: