From 1f89be1c39e1d894fee9dbd0d56b5ab565888ecd Mon Sep 17 00:00:00 2001 From: Kelvin Schoofs Date: Tue, 26 Jun 2018 14:41:07 +0200 Subject: [PATCH] ssh2-streams already support PPK. Update README.md --- README.md | 5 +++++ src/manager.ts | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a0fc3ea..85fa02a 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ This extension makes use of the new FileSystemProvider, added in version 1.23.0 ## Summary * Use a remote directory (over SSH) as workspace folder * Use agents, including Pageant for Windows +* Use private keys (any supported by ssh2-streams, including PuTTY's PPK) * Get prompted for a password/passphrase (plain text password aren't required) * Easily create configurations that reference a PuTTY session/configuration * Have multiple SSH (and regular) workspace folders at once @@ -65,6 +66,10 @@ Add SSH FS configs to "sshfs.configs" in your User Settings: // Or a private key (raw key, OpenSSH format) // (can also be a public key for host-based authentication) "privateKey": "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnN...", + // It's a lot easier to use a path, though + "privateKeyPath": "/root/.ssh/myPrivateKey", + // Also supports PPK keys + "privateKeyPath": "C:/Users/Kelvin/.ssh/myPrivateKey.ppk", // Should the private key be encrypted "passphrase": "CorrectHorseBatteryStaple", // Same as with the password, we can let it prompt us diff --git a/src/manager.ts b/src/manager.ts index 7627728..f2b77a8 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -183,9 +183,7 @@ export class Manager implements vscode.FileSystemProvider, vscode.TreeDataProvid throw new Error(`A SSH filesystem with the name '${name}' doesn't exist`); } this.registerFileSystem(name, { ...config }); - const sock = await createSocket(config); - if (sock == null) return reject(null); - const client = await createSSH(config, sock); + const client = await createSSH(config); if (!client) return reject(null); let root = config!.root || '/'; if (root.startsWith('~')) {