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) - // }) }) }) }