diff --git a/.gitignore b/.gitignore index 0319ee5029c262a0ff449c272f5c3b5a9c100743..4a74c238f610ac5711b5d12413540ab0983ccc26 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ docs/api .electron-symbols sentry.properties sentry-symbols.js + +terminus-ssh/util/pagent.exe diff --git a/terminus-ssh/package.json b/terminus-ssh/package.json index dc1e0d97e3ce0f85d9406938af2ab6774cd7bd0b..9ca98396f31e5a494a5c20beee5d290e23c764e4 100644 --- a/terminus-ssh/package.json +++ b/terminus-ssh/package.json @@ -9,10 +9,12 @@ "typings": "typings/index.d.ts", "scripts": { "build": "webpack --progress --color", - "watch": "webpack --progress --color --watch" + "watch": "webpack --progress --color --watch", + "postinstall": "xcopy /i node_modules\\ssh2\\util\\pagent.exe util\\" }, "files": [ - "dist" + "dist", + "util/pagent.exe" ], "author": "Eugene Pankov", "license": "MIT", diff --git a/terminus-ssh/src/api.ts b/terminus-ssh/src/api.ts index 91a3365ce1c39c3e8825d5a5a9f522f97cd8449c..9f39f7945175fbe8fbd549872173ac265a7834db 100644 --- a/terminus-ssh/src/api.ts +++ b/terminus-ssh/src/api.ts @@ -36,6 +36,7 @@ export interface SSHConnection { skipBanner?: boolean disableDynamicTitle?: boolean jumpHost?: string + agentForward?: boolean algorithms?: {[t: string]: string[]} } diff --git a/terminus-ssh/src/components/editConnectionModal.component.pug b/terminus-ssh/src/components/editConnectionModal.component.pug index d353b5fb53c672a103249290187da71273d7118a..cc993f7859b192a542681213799a25a2344a7abf 100644 --- a/terminus-ssh/src/components/editConnectionModal.component.pug +++ b/terminus-ssh/src/components/editConnectionModal.component.pug @@ -83,6 +83,11 @@ .title X11 forwarding toggle([(ngModel)]='connection.x11') + .form-line + .header + .title Allow Agent Forwarding + toggle([(ngModel)]='connection.agentForward') + .form-line .header .title Tab color diff --git a/terminus-ssh/src/services/ssh.service.ts b/terminus-ssh/src/services/ssh.service.ts index 622efb94daca7e88b4ecc69ec3aaaafd85101665..9fd4b95a262a76f37d41bdff5cddc6471e03c456 100644 --- a/terminus-ssh/src/services/ssh.service.ts +++ b/terminus-ssh/src/services/ssh.service.ts @@ -16,10 +16,6 @@ import { PromptModalComponent } from '../components/promptModal.component' import { PasswordStorageService } from './passwordStorage.service' import { SSHTabComponent } from '../components/sshTab.component' -try { - var windowsProcessTreeNative = require('windows-process-tree/build/Release/windows_process_tree.node') // eslint-disable-line @typescript-eslint/no-var-requires, no-var -} catch { } - @Injectable({ providedIn: 'root' }) export class SSHService { private logger: Logger @@ -187,14 +183,7 @@ export class SSHService { let agent: string|null = null if (this.hostApp.platform === Platform.Windows) { - const pageantRunning = new Promise(resolve => { - windowsProcessTreeNative.getProcessList(list => { // eslint-disable-line block-scoped-var - resolve(list.some(x => x.name === 'pageant.exe')) - }, 0) - }) - if (await pageantRunning) { - agent = 'pageant' - } + agent = 'pageant' } else { agent = process.env.SSH_AUTH_SOCK as string } @@ -208,7 +197,7 @@ export class SSHService { privateKey: privateKey || undefined, tryKeyboard: true, agent: agent || undefined, - agentForward: !!agent, + agentForward: session.connection.agentForward && !!agent, keepaliveInterval: session.connection.keepaliveInterval, keepaliveCountMax: session.connection.keepaliveCountMax, readyTimeout: session.connection.readyTimeout,