liximomo / vscode-remote-fs

Working with any file in everywhere with vscode.
MIT License
165 stars 17 forks source link

Cannot parse privateKey: Unsupported OpenSSH private key type: ssh-ed25519 #76

Open colemickens opened 4 years ago

colemickens commented 4 years ago

Describe the bug

I can't use my ed25519 key with this extension. It looks like simply bumping to the very next bugfix release of ssh2 would fix this: https://github.com/mscdex/ssh2/issues/352

This extension is the most valuable extension across all of my VS Code instances. Thank you very much for developing it, and thank you for allowing it to work in Codium (whereas Microsoft's version does not).

To Reproduce Steps to reproduce the behavior:

  1. Try to connect to a host using a ssh-ed25519 key.

Extension Logs - required

[trace] readFile /.vscode/settings.json
[trace] readFile /.vscode/tasks.json
[trace] readFile /.vscode/launch.json
[trace] readFile /.vscode/settings.json
[trace] readFile /.vscode/tasks.json
[trace] readFile /.vscode/launch.json
[trace] stat /.vscode/settings.json
[trace] stat /.vscode/tasks.json
[trace] stat /.vscode/launch.json
[trace] stat /.vscode/settings.json
[trace] stat /.vscode/tasks.json
[trace] stat /.vscode/launch.json
[trace] stat /
[trace] stat /.vscode/extensions.json
[trace] stat /.vscode/extensions.json
[error] Error: Cannot parse privateKey: Unsupported OpenSSH private key type: ssh-ed25519
    at Client.connect (c:\Users\colem\.vscode-oss\extensions\liximomo.remotefs-0.0.16\node_modules\ssh2\lib\client.js:241:13)
    at c:\Users\colem\.vscode-oss\extensions\liximomo.remotefs-0.0.16\out\src\fs-providers\SFTPFSProvider.js:240:22
    at new Promise (<anonymous>)
    at SFTPFSProvider.<anonymous> (c:\Users\colem\.vscode-oss\extensions\liximomo.remotefs-0.0.16\out\src\fs-providers\SFTPFSProvider.js:217:20)
    at Generator.next (<anonymous>)
    at c:\Users\colem\.vscode-oss\extensions\liximomo.remotefs-0.0.16\out\src\fs-providers\SFTPFSProvider.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (c:\Users\colem\.vscode-oss\extensions\liximomo.remotefs-0.0.16\out\src\fs-providers\SFTPFSProvider.js:3:12)
    at SFTPFSProvider._connectClient (c:\Users\colem\.vscode-oss\extensions\liximomo.remotefs-0.0.16\out\src\fs-providers\SFTPFSProvider.js:216:16)
    at SFTPFSProvider.<anonymous> (c:\Users\colem\.vscode-oss\extensions\liximomo.remotefs-0.0.16\out\src\fs-providers\SFTPFSProvider.js:73:25)
    at Generator.next (<anonymous>)
    at fulfilled (c:\Users\colem\.vscode-oss\extensions\liximomo.remotefs-0.0.16\out\src\fs-providers\SFTPFSProvider.js:4:58)
[ this error repeats ]
mmarcato commented 2 years ago

I have the same issue with this. I changed the ssh key generation method.

ssh-keygen -m PEM -t ed25519

I overcame that problem, but I got a new one... "all configured authentication methods failed"

yellow-sunshine commented 3 months ago

When you generate an ssh file you can specify the encryption type. It seems ed25519 is not supported by Remote FS. If you create a new key and specify rsa then it will work: ssh-keygen -t rsa -b 4096 -f ~/.ssh/your_key Of course this would require you to update the authorized_keys on the server with the pub. If you don't have control over the server then you will prob be looking to use something other than Remote FS until it supports ed25519