From c3a689cc962e0078101068041bbb6c49b9ad2605 Mon Sep 17 00:00:00 2001 From: chaos-zhu Date: Thu, 15 Aug 2024 10:45:40 +0800 Subject: [PATCH] =?UTF-8?q?:new:=20=E6=96=B0=E5=A2=9E=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/app/config/shell.json | 5 +++++ server/app/socket/terminal.js | 10 ---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/server/app/config/shell.json b/server/app/config/shell.json index 80f3ea1..272549a 100644 --- a/server/app/config/shell.json +++ b/server/app/config/shell.json @@ -13,5 +13,10 @@ "name": "查询本机公网IP", "command": "curl ifconfig.me", "description": "查询本机公网IP" + }, + { + "name": "生成ssh密钥对", + "command": "ssh-keygen -t rsa -b 2048", + "description": "生成ssh密钥对" } ] \ No newline at end of file diff --git a/server/app/socket/terminal.js b/server/app/socket/terminal.js index 55c3fab..3353476 100644 --- a/server/app/socket/terminal.js +++ b/server/app/socket/terminal.js @@ -17,16 +17,6 @@ function createInteractiveShell(socket, sshClient) { sshClient.end() }) socket.emit('connect_shell_success') // 已连接终端,web端可以执行指令了 - // web端输入 - // socket.on('input', key => { - // if (sshClient._sock.writable === false) return consola.info('终端连接已关闭,禁止输入') - // stream.write(key) - // }) - // 监听按键重置终端大小 - // socket.on('resize', ({ rows, cols }) => { - // // consola.info('更改tty终端行&列: ', { rows, cols }) - // stream.setWindow(rows, cols) - // }) }) }) }