fix: split su command into separate args for ttyd
Made-with: Cursor
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user