From 5f5b976f5b38ce401c94d2d5449484ea6c81489a Mon Sep 17 00:00:00 2001 From: stswangzhiping <59632378+stswangzhiping@users.noreply.github.com> Date: Mon, 16 Mar 2026 16:21:11 +0800 Subject: [PATCH] fix: split su command into separate args for ttyd Made-with: Cursor --- lib/frpc.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/frpc.js b/lib/frpc.js index 54d0d31..1d4ed81 100644 --- a/lib/frpc.js +++ b/lib/frpc.js @@ -121,8 +121,7 @@ async function startTtyd() { const shell = fs.existsSync('/bin/bash') ? '/bin/bash' : '/bin/sh'; // 以普通用户身份启动 shell(与 SSH 登录一致) const ttydUser = process.env.CLAWD_TTY_USER || 'sts'; - const loginCmd = `/bin/su - ${ttydUser}`; - const proc = spawn(TTYD_BIN, ['-p', String(TTYD_PORT), '-i', '127.0.0.1', '-W', '-t', 'cursorBlink=true', loginCmd], { + const proc = spawn(TTYD_BIN, ['-p', String(TTYD_PORT), '-i', '127.0.0.1', '-W', '-t', 'cursorBlink=true', '/bin/su', '-', ttydUser], { stdio: 'ignore', detached: true, });