ssh-mcp-server@0.4.1
CAUTION· startup onlyPublisher claims: "Enables AI clients (ZCode, Claude Code, Codex, Cursor, Cline) to run shell commands, manage background jobs, and stream files to and from remote Linux servers over SSH through a single authenticated MCP gateway. Target machines' SSH port stays closed to AI and the internet, with token whitelists, command blacklists, confirmations, and audit logging layered on top." Observed in sandbox: no network, touches nothing outside the project, writes no memory.
Coverage
Startup only; authenticated tool behavior not tested.- Tested
- server startup over stdio (initialize sent) · every file read, file written and host contacted by what ran
- Not tested
- the tool list (the server exited before answering) · what the tools do when called with real credentials
What this means for the label: Caution here covers what ran. The server's tools were not exercised with a real credential, so nothing about their behavior is asserted; the credential summary below says what to do with that.
Behavior
In our sandbox run on 2026-11-15, [email protected] read no files and called no hosts, and its code names 11 environment variables. Coverage: startup only.
Files read
None recorded.
Hosts called
None recorded.
Environment variables its code names
NGINX_URL, PUBKEY_FILE, SSH_MCP_CONFIG, SSH_MCP_HOST, SSH_MCP_PORT, SSH_MCP_TLS_CERT, SSH_MCP_TLS_KEY, SSH_MCP_TOKEN, SSH_MCP_TOKEN_FILE, SSH_MCP_TRANSPORT, SSH_MCP_TRUST_PROXY
Names only, read from the code. We never hold a value.
Tools offered
No tool list recorded.
Changes since the prior version
No prior version with a result to compare.
What we did not test
- the tool list (the server exited before answering)
- what the tools do when called with real credentials
| Run date | 2026-11-15 |
| Coverage | startup only |
| Engine | 1.9.2, script@linux |
| Reproduce | npx -y vet-skills try ssh-mcp-server |
| This record | behavior.json, behavior.md, signed attestation |
This is a record of what one version did in the runs we made. It is evidence, not a certificate.
Before you give it your token
- It will ask for
SSH_MCP_TOKENSSH_MCP_TOKEN_FILEConfiguration, not credentials: NGINX_URL, PUBKEY_FILE, SSH_MCP_CONFIG, SSH_MCP_HOST, SSH_MCP_PORT, SSH_MCP_TLS_CERT, SSH_MCP_TLS_KEY, SSH_MCP_TRANSPORT, SSH_MCP_TRUST_PROXY- Where it talks to
- no vendor host named in the code
- What we saw when it ran
- no credential files read · no network
- What we could not test
- the tool list (the server exited before answering) · what the tools do when called with real credentials
Connect it with a scoped credential, under the guard. It asks for SSH_MCP_TOKEN, SSH_MCP_TOKEN_FILE and talks to its vendor. Give the credential to the guard, not the server: the value never enters the server's environment and only travels to the host you bind. What the tools do with a real credential was not observed.
Never paste a credential into a chat, a ticket or a report, including ours. How the guard holds it.
Is [email protected] safe to install?
KillerSkills ran it in the KillerSkills honeypot sandbox (2 scenarios; startup only; authenticated tool behavior not tested) on 2026-11-15 and scored it 65/100 (Caution). It is not known to be malicious, but it has behaviour or code a security policy should decide on before install. Notable findings: Destructive command against a filesystem root or device; Destructive file system command detected; Privileged sudo command. Summary: no network, touches nothing outside the project, writes no memory.
Behavior trace
Honeypot run · 27 s · 2 scenarios · 0 deviationsStatic findings
for (const cmd of ["rm -rf /", 'rm -rf "/tmp/demo"', "find / -delete", "mkfs.ext4 /dev/sda", "dd if=/dev/zero of=/dev/sda", "shred /dev/sdb", "echo x > /etc/shadow"]) {Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.await runCommandRetry(s, "rm -rf /opt/ai-demo && echo 已清理");Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.echo "提示: root 权限操作请走 sudo 白名单内命令,或在白名单中按需追加。"Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.visudo -c -f /etc/sudoers.d/aiopsFix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.await c.callTool({ name: "run_command", arguments: { command: "rm -f /tmp/ssh-mcp-midstream.bin" } });Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.for (const cmd of ['rm -rf /', 'bash -c "rm -rf /"', "sh -c 'rm -rf /'", "rm -fr /*", "rm -f -r /"]) {Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.// rm 递归+强制作用根/通配根:/ 后不允许再出现路径字符("rm -rf /"、'rm -rf /'、rm -rf /* 均命中;rm -rf /tmp 不受影响)Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell....env,Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.* 公钥来源:~/.ssh/id_ed25519.pub(不存在则自动生成)Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.# AI 专用账号 sudo 白名单:全部强制 --no-pager 防 less 分页器逃逸(!sh 提权)Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.// rm 递归+强制作用根/通配根:/ 后不允许再出现路径字符("rm -rf /"、'rm -rf /'、rm -rf /* 均命中;rm -rf /tmp 不受影响)Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.// 要求 / 后跟空白/结尾/星号,`bash -c "rm -rf /"` 的闭引号导致漏判)。Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.arguments: { command: "rm -rf / --no-preserve-root" },Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.* 公钥来源:~/.ssh/id_ed25519.pub(不存在则自动生成)Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose."privateKeyPath": "~/.ssh/id_ed25519",Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.arguments: { command: "rm -rf / --no-preserve-root" },Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.check(normalizeRemotePath("/tmp/../etc/passwd") === "/etc/passwd", "A0 路径规范化处理 ..");Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.["真实写/读/删文件", 'echo "这条内容由 AI 于 $(date +%T) 通过 SSH 写入" > /tmp/ai-demo.txt && cat /tmp/ai-demo.txt && rm /tmp/ai-demo.txt && echo 已删除'],Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.await client.callTool({ name: "run_command", arguments: { command: "rm -f /tmp/ssh-mcp-e2e-200k.bin" } });Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.// rm 递归+强制作用根/通配根(含引号与 sudo 前缀变体;目录级如 rm -rf /tmp 不入确认清单,由黑名单/用户判断)Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.await client.callTool({ name: "run_command", arguments: { command: "rm -f /tmp/ssh-mcp-e2e-test.txt" } });Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.const blocked = checkBlocked("rm -rf / --no-preserve-root");Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.await client.callTool({ name: "run_command", arguments: { command: "rm -f /tmp/ssh-mcp-e2e-binary.bin" } });Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.for (const cmd of ["rm -rf /", 'rm -rf "/tmp/demo"', "find / -delete", "mkfs.ext4 /dev/sda", "dd if=/dev/zero of=/dev/sda", "shred /dev/sdb", "echo x > /etc/shadow"]) {Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.const child = startServer(rejectPort++, { env: { SSH_MCP_CONFIG: cfgPath, ...env } });Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.// 要求 / 后跟空白/结尾/星号,`bash -c "rm -rf /"` 的闭引号导致漏判)。Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.console.log(`读 /etc/shadow -> ${hit2 ? "已拦截 ✅" : "未拦截 ❌"}`);Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.const hit2 = checkBlockedPath("/etc/shadow");Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.# 在目标机上以 root 执行;公钥文件内容来自网关侧(本机 ~/.ssh/id_ed25519.pub)Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.# 3. 写 /etc/sudoers.d/aiops 白名单(只读探查 + 受控服务管理,需 NOPASSWD 的按需删改)Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.cfg.servers[0] = { id: 'self', name: 'ci-target', host: '127.0.0.1', port: 22, username: process.env.USER, privateKeyPath: '~/.ssh/id_ed25519' };Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.# 在目标机上以 root 执行;公钥文件内容来自网关侧(本机 ~/.ssh/id_ed25519.pub)Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.for (const cmd of ['rm -rf /', 'bash -c "rm -rf /"', "sh -c 'rm -rf /'", "rm -fr /*", "rm -f -r /"]) {Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.await client.callTool({ name: "run_command", arguments: { command: "rm -f /tmp/ssh-mcp-escape-link" } });Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.assert.ok(!checkBlocked("rm -rf /tmp/build"));Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.const rootHard = await call({ command: 'bash -c "rm -rf /"' });Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.const blacklist = await call({ command: "rm -rf /", confirm: true });Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keysFix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.arguments: { command: "rm -rf /opt/nginx-demo" },Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.chmod 440 /etc/sudoers.d/aiopsFix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.await run("⑧ 清理演示文件", `rm -f /tmp/app.conf /tmp/app.json && echo 已清理`);Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.const blocked = checkBlocked("rm -rf / --no-preserve-root");Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell."privateKeyPath": "~/.ssh/id_ed25519",Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.cat > /etc/sudoers.d/aiops <<'SUDOEOF'Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.check(!!checkBlockedPath("/tmp/../etc/passwd"), "A0 敏感路径黑名单匹配规范化路径");Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.sudo mkdir -p /run/sshdFix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.`[ssh-mcp-server] HTTP 模式已启动: ${tlsOptions ? "https" : "http"}://${host}:${port}/mcp ,` +Fix: Namespace tool names and keep tool descriptions literal; no instructions to the agent inside them.if (cm.exitCode !== 0) return finish({ ok: false, code: 500, error: `chmod 失败: ${cm.stderr}`, bytes: count });Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.mkdir -p ~/.ssh && chmod 700 ~/.sshFix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.mkdir -p ~/.ssh && chmod 700 ~/.sshFix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.sudo ssh-keygen -AFix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.`kill -TERM "$PID" 2>/dev/null; pkill -TERM -P "$PID" 2>/dev/null; sleep 0.5; ` +Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.sudo apt-get install -y -qq openssh-serverFix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.arguments: { command: "printf OLD > /tmp/ssh-mcp-e2e-test.txt && chmod 640 /tmp/ssh-mcp-e2e-test.txt" },Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keysFix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.sudo /usr/sbin/sshdFix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.`touch /root/.ssh/authorized_keys && chmod 600 /root/.ssh/authorized_keys && ` +Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.check(chmodBlocked.isError && String(chmodBlocked.content?.[0]?.text).includes("安全策略拦截"), "A4 chmod -R 777 / 被新黑名单拦截");Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.chmod 600 ~/.ssh/authorized_keysFix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keysFix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.const cm = await execOnConn(conn, `chmod ${finalMode} ${shq(tempPath)}`);Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.chown aiops:aiops /home/aiops/.ssh/authorized_keysFix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.MCP server lvxiangjin/ssh-mcp-server on Glama, built from https://github.com/lvxiangjin/ssh-mcp-server.Fix: Namespace tool names and keep tool descriptions literal; no instructions to the agent inside them.chmod +x "$OUT"Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts."[ssh-mcp-server] HTTP 模式需要至少一种凭据来源:SSH_MCP_TOKEN 环境变量," +Fix: Namespace tool names and keep tool descriptions literal; no instructions to the agent inside them.sudo apt-get update -qqFix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.`elif [ -f ${shq(dir + "/pid")} ] && kill -0 "$(cat ${shq(dir + "/pid")})" 2>/dev/null; then echo "state: running"; ` +Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.chmod 600 "$KEY"Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.`kill -KILL "$PID" 2>/dev/null; pkill -KILL -P "$PID" 2>/dev/null; ` +Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose."mkdir -p /root/.ssh && chmod 700 /root/.ssh && " +Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.`[ssh-mcp-server] 未知的 SSH_MCP_TRANSPORT: ${transportMode}(支持 stdio / http)`Fix: Namespace tool names and keep tool descriptions literal; no instructions to the agent inside them.npx postject "$OUT" NODE_SEA_BLOB "$WORK/sea-prep.blob" \Fix: Pin versions and sources; vendor anything fetched at install time.throw new Error(`\u8def\u5f84\u4e0d\u5728\u5141\u8bb8\u8303\u56f4\u5185: ${normalized}`);Fix: Put hosts, commands and strings in plain source. Decoding at runtime looks identical to malware and costs points on its own.const cm = await safeExec(`chmod ${finalMode} ${shq(tempPath)}`);Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.if (cm.exitCode !== 0) throw new Error(`chmod 失败: ${cm.stderr}`);Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.check(m.status === 200 && m.body.includes("ssh-mcp-server"), "V1 HTTPS 下 /mcp 鉴权与协议正常");Fix: Namespace tool names and keep tool descriptions literal; no instructions to the agent inside them.npx esbuild "$SRC/server.js" \Fix: Pin versions and sources; vendor anything fetched at install time.check(rBlk.status === 400 && String((await rBlk.json()).error).includes("安全策略拦截"), "A3 敏感路径黑名单同样拦截 /upload");Fix: Remove the call, or declare the host in frontmatter and explain in the README what is sent and why.chmod 440 /etc/sudoers.d/aiopsFix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.audit.log({ ip, tokenId, tool: "upload_stream", args, ok, error: error ?? null });Fix: Remove the call, or declare the host in frontmatter and explain in the README what is sent and why.cfg.servers[0] = { id: 'self', name: 'ci-target', host: '127.0.0.1', port: 22, username: process.env.USER, privateKeyPath: '~/.ssh/id_ed25519' };Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.const chmodBlocked = await client.callTool({ name: "run_command", arguments: { command: "chmod -R 777 /" } });Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.chmod 600 /home/aiops/.ssh/authorized_keysFix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.console.log("\n== 3. upload_file(经 Nginx)==");Fix: Remove the call, or declare the host in frontmatter and explain in the README what is sent and why..json({ error: `文件过大(${cl} 字节 > 上限 ${streamUploadMax}),可在 config.json 的 defaults.maxStreamUploadBytes 调整` });Fix: Remove the call, or declare the host in frontmatter and explain in the README what is sent and why.const jsonParser = express.json({ limit: Math.ceil(defaults.maxUploadBytes * 1.4) + 256 * 1024 });Fix: Remove the call, or declare the host in frontmatter and explain in the README what is sent and why.Cost to the agent
Tokens estimated at four characters each. The tool list is re-read by the agent on every turn, so it is the number to compare between servers that do the same job: ranked across the index.
Known vulnerabilities
Vulnerability advisories (OSV) cover npm and PyPI packages; this registry has no advisory database.
What would make this Verified
15 points to 80 · weights: behavior 45%, static 25%, prompt 15%, publisher 15%- Destructive command against a filesystem root or device≈ +9 on the totalBuild commands from fixed arguments; do not interpolate untrusted strings into a shell.
- Unclaimed publisher≈ +8 on the totalClaim lvxiangjin: a verified publisher gets +50 on publisher trust. It is free and usually instant with GitHub sign-in.
- Destructive file system command detected≈ +4 on the totalBuild commands from fixed arguments; do not interpolate untrusted strings into a shell.
- Privileged sudo command≈ +4 on the totalBuild commands from fixed arguments; do not interpolate untrusted strings into a shell.
- Access to sensitive file paths≈ +4 on the totalStop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.
- References a credential file in the home directory≈ +4 on the totalStop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.