From d8d255980e37a438c179c7653d8f9b8e207e2123 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Tue, 22 Apr 2025 15:53:19 +0800 Subject: [PATCH] chore: --- .../plugins/plugin-lib/src/ssh/ssh-access.ts | 18 +++++++++--------- packages/plugins/plugin-lib/src/ssh/ssh.ts | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/plugins/plugin-lib/src/ssh/ssh-access.ts b/packages/plugins/plugin-lib/src/ssh/ssh-access.ts index ecf75519..2247b9bf 100644 --- a/packages/plugins/plugin-lib/src/ssh/ssh-access.ts +++ b/packages/plugins/plugin-lib/src/ssh/ssh-access.ts @@ -63,15 +63,15 @@ export class SshAccess extends BaseAccess { }) passphrase!: string; - // @AccessInput({ - // title: "伪终端", - // helper: "如果登录报错:all authentication methods failed,可以尝试开启伪终端模式进行keyboard-interactive方式登录", - // component: { - // name: "a-switch", - // vModel: "checked", - // }, - // }) - // pty!: boolean; + @AccessInput({ + title: "伪终端", + helper: "如果登录报错:all authentication methods failed,可以尝试开启伪终端模式进行keyboard-interactive方式登录\n开启后对日志输出有一定的影响", + component: { + name: "a-switch", + vModel: "checked", + }, + }) + pty!: boolean; @AccessInput({ title: "socks代理", diff --git a/packages/plugins/plugin-lib/src/ssh/ssh.ts b/packages/plugins/plugin-lib/src/ssh/ssh.ts index b6322c47..1648c1e4 100644 --- a/packages/plugins/plugin-lib/src/ssh/ssh.ts +++ b/packages/plugins/plugin-lib/src/ssh/ssh.ts @@ -172,7 +172,7 @@ export class AsyncSsh2Client { this.logger.info(`执行命令:[${this.connConf.host}][exec]: \n` + script); // pty 伪终端,window下的输出会带上conhost.exe之类的多余的字符串,影响返回结果判断 // linux下 当使用keyboard-interactive 登录时,需要pty - const pty = !this.connConf.windows //linux下开启伪终端,windows下不开启 + const pty = this.connConf.pty; //linux下开启伪终端,windows下不开启 this.conn.exec(script, { pty, env: opts.env }, (err: Error, stream: any) => { if (err) { reject(err);