mcp-ssh-manager 3.8.1 → 3.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +50 -9
- package/package.json +5 -3
- package/server.json +36 -0
- package/src/deploy-helper.js +20 -20
- package/src/index.js +28 -10
- package/src/ssh-manager.js +22 -1
- package/.claude/settings.local.json +0 -96
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,35 @@ All notable changes to MCP SSH Manager will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.8.3] - 2026-08-28
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **First release published from CI with build provenance and an attested SBOM.** 3.8.2 shipped the workflow but was still published by hand, so it carried no attestation — `npm audit signatures` found none for it, while the comparable competitor had both an npm publish attestation and SLSA provenance. This release closes that gap for real: anyone can now verify which commit and which workflow built the tarball.
|
|
13
|
+
- **`zod` 3 → 4** ([#65](https://github.com/bvisible/mcp-ssh-manager/pull/65)). Verified before merging rather than after: with zod 4 installed, all 37 tools still register over a real MCP stdio handshake, and the full suite, typecheck and lint stay green. `@modelcontextprotocol/sdk` accepts `^3.25 || ^4.0`, and knip already wanted `^4.1.11`.
|
|
14
|
+
- `actions/checkout` and `actions/setup-node` bumped to v7 ([#61](https://github.com/bvisible/mcp-ssh-manager/pull/61), [#62](https://github.com/bvisible/mcp-ssh-manager/pull/62)).
|
|
15
|
+
|
|
16
|
+
### Note
|
|
17
|
+
|
|
18
|
+
TypeScript 7 ([#64](https://github.com/bvisible/mcp-ssh-manager/issues/64)) and ESLint 10 ([#63](https://github.com/bvisible/mcp-ssh-manager/issues/63)) were declined, not deferred by accident: knip 5 pins `peer typescript ">=5.0.4 <7"`, and ESLint 9+ requires migrating off `.eslintrc` to flat config — tracked in [#66](https://github.com/bvisible/mcp-ssh-manager/issues/66).
|
|
19
|
+
|
|
20
|
+
## [3.8.2] - 2026-08-28
|
|
21
|
+
|
|
22
|
+
### Security
|
|
23
|
+
|
|
24
|
+
- **The sudo password no longer reaches the remote command line** ([#34](https://github.com/bvisible/mcp-ssh-manager/issues/34)). `ssh_execute_sudo` and the three privileged steps of `ssh_deploy` built `echo "<password>" | sudo -S <cmd>`, which published the password to the remote process list, `/proc/<pid>/cmdline` and any `auditd` trail for the lifetime of the `echo` — readable by every account on the host. The existing output masking never helped: it only redacted the copy sent back to the agent. The password now travels on the SSH exec channel's stdin (`sudo -S -k -p ''`), where no other process can observe it. `-k` is required: without it an already-authorised sudo skips the prompt, leaving the password in the pipe for the command itself to read as input. Guarded by `npm run test:sudostdin`, which also fails if the old pipeline reappears anywhere in `src/`.
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- **`server.json`** — the manifest for the official [MCP Registry](https://registry.modelcontextprotocol.io), published as `io.github.bvisible/mcp-ssh-manager`, plus the `mcpName` field in `package.json` that proves package ownership. The registry is what feeds MCP clients today; the project was absent from it.
|
|
29
|
+
- **OpenSSF Scorecard workflow and badge** — a public grade of the repository's supply-chain posture. For a server that hands an agent a shell on production machines, that grade is part of the product.
|
|
30
|
+
- **`Release` workflow** publishing to npm with build provenance and attaching a CycloneDX SBOM to each GitHub release. Removes the hand-publish step that failed twice on 2026-08-28 (expired token, then a 2FA prompt), and lets anyone verify the tarball's origin with `npm audit signatures`.
|
|
31
|
+
- **README section "Giving an agent SSH access, safely"** documenting the per-server `unrestricted` / `readonly` / `restricted` modes, which existed since v3.5.0 but were never surfaced where readers land.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- `SSHManager.execCommand` accepts an `stdin` option, written to the exec channel and then closed. Commands that pass no stdin are untouched, so interactive remote processes keep working.
|
|
36
|
+
|
|
8
37
|
## [3.8.1] - 2026-08-28
|
|
9
38
|
|
|
10
39
|
### Added
|
package/README.md
CHANGED
|
@@ -6,10 +6,11 @@ A Model Context Protocol (MCP) server that enables **Claude Code** and **OpenAI
|
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/mcp-ssh-manager)
|
|
8
8
|
[](https://www.npmjs.com/package/mcp-ssh-manager)
|
|
9
|
-
[](https://github.com/bvisible/mcp-ssh-manager/releases/tag/v3.8.3)
|
|
10
10
|
[](https://claude.ai/code)
|
|
11
11
|
[](https://openai.com/codex)
|
|
12
12
|
[](https://modelcontextprotocol.io)
|
|
13
|
+
[](https://scorecard.dev/viewer/?uri=github.com/bvisible/mcp-ssh-manager)
|
|
13
14
|
[](LICENSE)
|
|
14
15
|
|
|
15
16
|
[](https://mcptoplist.com/server/glama%2Fbvisible%2Fmcp-ssh-manager)
|
|
@@ -22,23 +23,63 @@ A Model Context Protocol (MCP) server that enables **Claude Code** and **OpenAI
|
|
|
22
23
|
|
|
23
24
|
---
|
|
24
25
|
|
|
25
|
-
## 🎉 What's New in v3.8.
|
|
26
|
+
## 🎉 What's New in v3.8.2
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
**🔐 The sudo password stops leaking to the remote process list, and the server joins the official MCP Registry** (Released: August 28, 2026)
|
|
28
29
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
30
|
+
- **🔒 Security fix: the sudo password no longer reaches the remote command line** ([#34](https://github.com/bvisible/mcp-ssh-manager/issues/34)) — `ssh_execute_sudo` and `ssh_deploy` built `echo "<password>" | sudo -S …`, leaving the password visible in `ps` and `/proc/<pid>/cmdline` to every account on the host. It now travels on the SSH channel's stdin, where nothing else can read it. A regression test fails if the old pattern comes back anywhere in `src/`.
|
|
31
|
+
- **📖 Listed in the official MCP Registry** as `io.github.bvisible/mcp-ssh-manager` — the registry that feeds MCP clients. The project was simply absent from it.
|
|
32
|
+
- **🛡️ OpenSSF Scorecard + signed provenance + SBOM** — releases now publish from CI with build provenance you can check via `npm audit signatures`, and each one carries a CycloneDX SBOM.
|
|
33
|
+
- **📋 The security modes are finally documented where people land** — `readonly` and `restricted` have existed since v3.5.0 and were buried. See the section right below.
|
|
33
34
|
|
|
34
|
-
[Read full changelog →](CHANGELOG.md#
|
|
35
|
+
[Read full changelog →](CHANGELOG.md#382---2026-08-28)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 🔐 Giving an agent SSH access, safely
|
|
40
|
+
|
|
41
|
+
An MCP SSH server is the most dangerous tool you can hand an AI agent: a shell on
|
|
42
|
+
machines that matter. This one is built so you decide how far the agent can go —
|
|
43
|
+
**per server**, not globally.
|
|
44
|
+
|
|
45
|
+
| Mode | What the agent can do |
|
|
46
|
+
|---|---|
|
|
47
|
+
| `unrestricted` *(default)* | Everything. Same behaviour as any other SSH MCP server. |
|
|
48
|
+
| `readonly` | Mutating tools are refused outright — no deploy, no upload, no sudo, no database import. Read commands still work. |
|
|
49
|
+
| `restricted` | Every command must match an allow pattern **and** no deny pattern. Anything else is refused before it reaches the host. |
|
|
50
|
+
|
|
51
|
+
```env
|
|
52
|
+
SSH_SERVER_PROD_MODE=readonly
|
|
53
|
+
SSH_SERVER_STAGING_MODE=restricted
|
|
54
|
+
SSH_SERVER_STAGING_ALLOW_PATTERNS=^systemctl (status|restart) myapp$;^tail -n \d+ /var/log/
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Alongside that:
|
|
58
|
+
|
|
59
|
+
- **The sudo password never reaches the remote command line.** It travels on the
|
|
60
|
+
SSH channel's stdin, so it is not visible in `ps`, in `/proc/<pid>/cmdline`, or
|
|
61
|
+
in an `auditd` trail — unlike the `echo "$pass" | sudo -S` pattern common in
|
|
62
|
+
this category ([#34](https://github.com/bvisible/mcp-ssh-manager/issues/34)).
|
|
63
|
+
- **Every database argument is shell-quoted** through one centralised helper,
|
|
64
|
+
guarded by a 648-combination injection test.
|
|
65
|
+
- **Read-only SQL is enforced**, not suggested: `ssh_db_query` refuses anything
|
|
66
|
+
that is not a `SELECT`.
|
|
67
|
+
- **Vulnerabilities are published, not buried.** See [SECURITY.md](SECURITY.md)
|
|
68
|
+
for the reporting process and the advisories already fixed.
|
|
69
|
+
- **Reproducible installs**: the lockfile is committed, CI installs with
|
|
70
|
+
`npm ci`, and a test enforces that every dependency resolves to
|
|
71
|
+
registry.npmjs.org with an integrity hash and no unreviewed install scripts.
|
|
35
72
|
|
|
36
73
|
---
|
|
37
74
|
|
|
38
75
|
## Previous Releases
|
|
39
76
|
|
|
40
77
|
<details>
|
|
41
|
-
<summary><b>📜 Release history — v3.8.
|
|
78
|
+
<summary><b>📜 Release history — v3.8.1 down to v1.0.0</b> (click to expand)</summary>
|
|
79
|
+
|
|
80
|
+
### v3.8.1 - Reproducible installs and blocking quality gates (August 28, 2026)
|
|
81
|
+
|
|
82
|
+
- **Committed lockfile** ([#60](https://github.com/bvisible/mcp-ssh-manager/pull/60) — contributed by [@cudatuda](https://github.com/cudatuda)) plus `npm run test:lockfile` guarding it against drift and tampering. CI installs with `npm ci`; ESLint and the JSDoc typecheck became blocking gates after being purely decorative. [Full changelog →](CHANGELOG.md#381---2026-08-28)
|
|
42
83
|
|
|
43
84
|
### v3.8.0 - Groups in your config, `ssh_sync` on Windows, tunnel crash fix (August 14, 2026)
|
|
44
85
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-ssh-manager",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.3",
|
|
4
|
+
"mcpName": "io.github.bvisible/mcp-ssh-manager",
|
|
4
5
|
"description": "MCP SSH Manager: Model Context Protocol server for SSH remote server management. Control SSH connections from Claude Code and OpenAI Codex - execute commands, transfer files, database operations, backups, health monitoring, and DevOps automation. NEW: Tool activation system reduces context usage by 92%",
|
|
5
6
|
"main": "src/index.js",
|
|
6
7
|
"bin": {
|
|
@@ -13,8 +14,9 @@
|
|
|
13
14
|
"setup": "npm install && pip install -r tools/requirements.txt",
|
|
14
15
|
"configure": "python tools/server-manager.py",
|
|
15
16
|
"test-connection": "python tools/test-connection.py",
|
|
16
|
-
"test": "npm run test:lockfile && npm run test:profiles && npm run test:aliases && npm run test:hooks && npm run test:tools && npm run test:policy && npm run test:ping && npm run test:config && npm run test:fieldnames && npm run test:groups && npm run test:agentforward && npm run test:lifecycle && npm run test:tunnel && npm run test:sync && npm run test:sync-path && npm run test:dbquoting && npm run test:dbinjection && npm run test:dbrowcount",
|
|
17
|
+
"test": "npm run test:lockfile && npm run test:sudostdin && npm run test:profiles && npm run test:aliases && npm run test:hooks && npm run test:tools && npm run test:policy && npm run test:ping && npm run test:config && npm run test:fieldnames && npm run test:groups && npm run test:agentforward && npm run test:lifecycle && npm run test:tunnel && npm run test:sync && npm run test:sync-path && npm run test:dbquoting && npm run test:dbinjection && npm run test:dbrowcount",
|
|
17
18
|
"test:lockfile": "node tests/test-lockfile.js",
|
|
19
|
+
"test:sudostdin": "node tests/test-sudo-stdin.js",
|
|
18
20
|
"test:profiles": "node tests/test-profiles.js",
|
|
19
21
|
"test:aliases": "node tests/test-command-aliases.js",
|
|
20
22
|
"test:hooks": "node tests/test-hooks.js",
|
|
@@ -92,7 +94,7 @@
|
|
|
92
94
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
93
95
|
"dotenv": "^16.4.5",
|
|
94
96
|
"ssh2": "^1.17.0",
|
|
95
|
-
"zod": "^
|
|
97
|
+
"zod": "^4.4.3"
|
|
96
98
|
},
|
|
97
99
|
"devDependencies": {
|
|
98
100
|
"eslint": "^8.56.0",
|
package/server.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.bvisible/mcp-ssh-manager",
|
|
4
|
+
"description": "SSH server management for agents, with per-server read-only and allowlist security modes",
|
|
5
|
+
"repository": {
|
|
6
|
+
"url": "https://github.com/bvisible/mcp-ssh-manager",
|
|
7
|
+
"source": "github"
|
|
8
|
+
},
|
|
9
|
+
"version": "3.8.3",
|
|
10
|
+
"packages": [
|
|
11
|
+
{
|
|
12
|
+
"registryType": "npm",
|
|
13
|
+
"identifier": "mcp-ssh-manager",
|
|
14
|
+
"version": "3.8.3",
|
|
15
|
+
"transport": {
|
|
16
|
+
"type": "stdio"
|
|
17
|
+
},
|
|
18
|
+
"environmentVariables": [
|
|
19
|
+
{
|
|
20
|
+
"name": "SSH_CONFIG_PATH",
|
|
21
|
+
"description": "Path to a TOML file holding the server definitions. Defaults to ~/.codex/ssh-config.toml. Each server can set MODE to readonly or restricted to constrain what the agent may run.",
|
|
22
|
+
"isRequired": false,
|
|
23
|
+
"isSecret": false,
|
|
24
|
+
"format": "filepath"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "SSH_ENV_PATH",
|
|
28
|
+
"description": "Path to a .env file declaring servers as SSH_SERVER_<NAME>_HOST, _USER, _KEYPATH and friends. Defaults to a .env next to the package.",
|
|
29
|
+
"isRequired": false,
|
|
30
|
+
"isSecret": false,
|
|
31
|
+
"format": "filepath"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
package/src/deploy-helper.js
CHANGED
|
@@ -51,40 +51,40 @@ export function buildDeploymentStrategy(remotePath, options = {}) {
|
|
|
51
51
|
strategy.requiresSudo = true;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
// A step that needs the sudo password carries it as `stdin`, never inside
|
|
55
|
+
// `command`. Interpolating it (`echo "<pass>" | sudo -S …`) published the
|
|
56
|
+
// password to the remote process list and /proc/<pid>/cmdline (issue #34).
|
|
57
|
+
// See the ssh_execute_sudo handler for what -S -k -p '' each do.
|
|
58
|
+
const sudoPrefix = sudoPassword ? 'sudo -S -k -p \'\' ' : 'sudo ';
|
|
59
|
+
const withSudoStdin = (step) => (sudoPassword ? { ...step, stdin: `${sudoPassword}\n` } : step);
|
|
60
|
+
|
|
54
61
|
// Step 3: Copy from temp to final location
|
|
55
|
-
const copyCmd = needsSudo
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
`sudo cp {{tempFile}} "${remotePath}"` :
|
|
59
|
-
`cp {{tempFile}} "${remotePath}"`;
|
|
62
|
+
const copyCmd = needsSudo ?
|
|
63
|
+
`${sudoPrefix}cp {{tempFile}} "${remotePath}"` :
|
|
64
|
+
`cp {{tempFile}} "${remotePath}"`;
|
|
60
65
|
|
|
61
|
-
strategy.steps.push({
|
|
66
|
+
strategy.steps.push(needsSudo ? withSudoStdin({
|
|
67
|
+
type: 'copy',
|
|
68
|
+
command: copyCmd
|
|
69
|
+
}) : {
|
|
62
70
|
type: 'copy',
|
|
63
71
|
command: copyCmd
|
|
64
72
|
});
|
|
65
73
|
|
|
66
74
|
// Step 4: Set ownership if specified
|
|
67
75
|
if (owner) {
|
|
68
|
-
|
|
69
|
-
`echo "${sudoPassword}" | sudo -S chown ${owner} "${remotePath}"` :
|
|
70
|
-
`sudo chown ${owner} "${remotePath}"`;
|
|
71
|
-
|
|
72
|
-
strategy.steps.push({
|
|
76
|
+
strategy.steps.push(withSudoStdin({
|
|
73
77
|
type: 'chown',
|
|
74
|
-
command:
|
|
75
|
-
});
|
|
78
|
+
command: `${sudoPrefix}chown ${owner} "${remotePath}"`
|
|
79
|
+
}));
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
// Step 5: Set permissions if specified
|
|
79
83
|
if (permissions) {
|
|
80
|
-
|
|
81
|
-
`echo "${sudoPassword}" | sudo -S chmod ${permissions} "${remotePath}"` :
|
|
82
|
-
`sudo chmod ${permissions} "${remotePath}"`;
|
|
83
|
-
|
|
84
|
-
strategy.steps.push({
|
|
84
|
+
strategy.steps.push(withSudoStdin({
|
|
85
85
|
type: 'chmod',
|
|
86
|
-
command:
|
|
87
|
-
});
|
|
86
|
+
command: `${sudoPrefix}chmod ${permissions} "${remotePath}"`
|
|
87
|
+
}));
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// Step 6: Restart service if specified
|
package/src/index.js
CHANGED
|
@@ -2284,7 +2284,14 @@ registerToolConditional(
|
|
|
2284
2284
|
for (const step of strategy.steps) {
|
|
2285
2285
|
const command = step.command.replace('{{tempFile}}', tempFile);
|
|
2286
2286
|
|
|
2287
|
-
|
|
2287
|
+
// step.stdin carries the sudo password for steps that need it, so it
|
|
2288
|
+
// never reaches the remote command line (issue #34).
|
|
2289
|
+
const result = await execCommandWithTimeout(
|
|
2290
|
+
ssh,
|
|
2291
|
+
command,
|
|
2292
|
+
{ platform: deployServerConfig?.platform, stdin: step.stdin ?? null },
|
|
2293
|
+
15000
|
|
2294
|
+
);
|
|
2288
2295
|
|
|
2289
2296
|
if (result.code !== 0 && step.type !== 'backup') {
|
|
2290
2297
|
throw new Error(`${step.type} failed: ${result.stderr}`);
|
|
@@ -2364,12 +2371,21 @@ registerToolConditional(
|
|
|
2364
2371
|
fullCommand = `sudo ${fullCommand}`;
|
|
2365
2372
|
}
|
|
2366
2373
|
|
|
2367
|
-
// Add password if provided
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2374
|
+
// Add password if provided. The password travels on the exec channel's
|
|
2375
|
+
// stdin, never inside the command string: the previous
|
|
2376
|
+
// `echo "<pass>" | sudo -S …` left it readable in the remote process list
|
|
2377
|
+
// and /proc/<pid>/cmdline for anyone with an account on the host (#34).
|
|
2378
|
+
// -S read the password from stdin
|
|
2379
|
+
// -k invalidate any cached sudo timestamp first, so sudo always
|
|
2380
|
+
// consumes the password we wrote. Without it, an already-authorised
|
|
2381
|
+
// sudo skips the prompt and the password stays in the pipe, where
|
|
2382
|
+
// the command itself would read it as its own input.
|
|
2383
|
+
// -p '' suppress the prompt, which would otherwise land in stderr.
|
|
2384
|
+
let sudoStdin = null;
|
|
2385
|
+
const effectiveSudoPassword = password || serverConfig?.sudoPassword;
|
|
2386
|
+
if (effectiveSudoPassword) {
|
|
2387
|
+
fullCommand = `sudo -S -k -p '' ${command.replace(/^sudo /, '')}`;
|
|
2388
|
+
sudoStdin = `${effectiveSudoPassword}\n`;
|
|
2373
2389
|
}
|
|
2374
2390
|
|
|
2375
2391
|
// Add working directory if specified
|
|
@@ -2390,10 +2406,12 @@ registerToolConditional(
|
|
|
2390
2406
|
}
|
|
2391
2407
|
}
|
|
2392
2408
|
|
|
2393
|
-
const result = await execCommandWithTimeout(ssh, fullCommand, { platform }, timeout);
|
|
2409
|
+
const result = await execCommandWithTimeout(ssh, fullCommand, { platform, stdin: sudoStdin }, timeout);
|
|
2394
2410
|
|
|
2395
|
-
//
|
|
2396
|
-
|
|
2411
|
+
// The command string no longer carries the password, so there is nothing
|
|
2412
|
+
// left to mask — the flags are shown as-is. Kept as a named value so the
|
|
2413
|
+
// response format is unchanged for existing callers.
|
|
2414
|
+
const maskedCommand = fullCommand;
|
|
2397
2415
|
|
|
2398
2416
|
return {
|
|
2399
2417
|
content: [
|
package/src/ssh-manager.js
CHANGED
|
@@ -188,7 +188,7 @@ class SSHManager {
|
|
|
188
188
|
throw new Error('Not connected to SSH server');
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
const { timeout = 30000, cwd, rawCommand = false } = options;
|
|
191
|
+
const { timeout = 30000, cwd, rawCommand = false, stdin = null } = options;
|
|
192
192
|
const fullCommand = (cwd && !rawCommand) ? `cd ${cwd} && ${command}` : command;
|
|
193
193
|
|
|
194
194
|
return new Promise((resolve, reject) => {
|
|
@@ -238,6 +238,27 @@ class SSHManager {
|
|
|
238
238
|
|
|
239
239
|
stream = streamObj;
|
|
240
240
|
|
|
241
|
+
// Feed the remote process on the exec channel's stdin. This is how the
|
|
242
|
+
// sudo password reaches `sudo -S` without ever appearing in the remote
|
|
243
|
+
// command line: interpolating it into `echo "..." | sudo -S` left it
|
|
244
|
+
// readable in `ps` and /proc/<pid>/cmdline for every account on the
|
|
245
|
+
// host, for the lifetime of the echo (issue #34). Closing the input
|
|
246
|
+
// afterwards tells sudo no more is coming; only done when a caller
|
|
247
|
+
// actually supplies stdin, so interactive commands are unaffected.
|
|
248
|
+
if (stdin !== null) {
|
|
249
|
+
try {
|
|
250
|
+
stream.write(stdin);
|
|
251
|
+
stream.end();
|
|
252
|
+
} catch (writeError) {
|
|
253
|
+
if (!completed) {
|
|
254
|
+
completed = true;
|
|
255
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
256
|
+
reject(writeError);
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
241
262
|
stream.on('close', (code, signal) => {
|
|
242
263
|
if (!completed) {
|
|
243
264
|
completed = true;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(mkdir:*)",
|
|
5
|
-
"Bash(npm install)",
|
|
6
|
-
"Bash(pip install:*)",
|
|
7
|
-
"Bash(python tools/server-manager.py:*)",
|
|
8
|
-
"Bash(python:*)",
|
|
9
|
-
"Bash(mv:*)",
|
|
10
|
-
"Bash(tree:*)",
|
|
11
|
-
"Bash(timeout:*)",
|
|
12
|
-
"Bash(npm install:*)",
|
|
13
|
-
"Bash(npm ls:*)",
|
|
14
|
-
"Bash(node test-mcp.js)",
|
|
15
|
-
"Bash(node:*)",
|
|
16
|
-
"WebFetch(domain:github.com)",
|
|
17
|
-
"Bash(rm:*)",
|
|
18
|
-
"Bash(cat:*)",
|
|
19
|
-
"Bash(chmod:*)",
|
|
20
|
-
"Bash(uv run:*)",
|
|
21
|
-
"Bash(./test-claude-code.sh:*)",
|
|
22
|
-
"Bash(git add:*)",
|
|
23
|
-
"Bash(git commit:*)",
|
|
24
|
-
"Bash(grep:*)",
|
|
25
|
-
"Bash(git remote add:*)",
|
|
26
|
-
"Bash(git push:*)",
|
|
27
|
-
"Bash(./scripts/validate.sh:*)",
|
|
28
|
-
"Bash(npm run test:all:*)",
|
|
29
|
-
"mcp__ssh-manager__ssh_list_servers",
|
|
30
|
-
"mcp__ssh-manager__ssh_execute",
|
|
31
|
-
"mcp__ssh-manager__ssh_alias",
|
|
32
|
-
"mcp__ide__getDiagnostics",
|
|
33
|
-
"Bash(npm ci:*)",
|
|
34
|
-
"Bash(npx eslint:*)",
|
|
35
|
-
"Bash(npm run validate:*)",
|
|
36
|
-
"Bash(git pull:*)",
|
|
37
|
-
"Bash(npm test:*)",
|
|
38
|
-
"Bash(black:*)",
|
|
39
|
-
"Bash(flake8:*)",
|
|
40
|
-
"Bash(gh run list:*)",
|
|
41
|
-
"WebSearch",
|
|
42
|
-
"Bash(git clone:*)",
|
|
43
|
-
"Bash(echo:*)",
|
|
44
|
-
"Bash(claude mcp:*)",
|
|
45
|
-
"Bash(brew install:*)",
|
|
46
|
-
"Bash(gh run view:*)",
|
|
47
|
-
"Bash(git checkout:*)",
|
|
48
|
-
"Bash(gh:*)",
|
|
49
|
-
"Bash(SSH_VERBOSE:*)",
|
|
50
|
-
"Bash(git cherry-pick:*)",
|
|
51
|
-
"Bash(git merge:*)",
|
|
52
|
-
"Bash(bash:*)",
|
|
53
|
-
"Bash(./migrate.sh)",
|
|
54
|
-
"Bash(SSH_MANAGER_ENV=\"/Users/jeremy/mcp/mcp-ssh-manager-fix/.env\" /Users/jeremy/.ssh-manager-cli/ssh-manager server list)",
|
|
55
|
-
"Read(//Users/jeremy/.ssh-manager-cli/**)",
|
|
56
|
-
"mcp__ssh-manager__ssh_upload",
|
|
57
|
-
"mcp__ssh-manager__ssh_sync",
|
|
58
|
-
"Bash(npm uninstall:*)",
|
|
59
|
-
"mcp__ssh-manager__ssh_download",
|
|
60
|
-
"Bash(SSH_MANAGER_ENV=\"/Users/jeremy/mcp/mcp-ssh-manager/.env\" bash -c 'source /Users/jeremy/.ssh-manager-cli/lib/config.sh && get_server_config \"\"efaje_production\"\" \"\"HOST\"\"')",
|
|
61
|
-
"Bash(SSH_MANAGER_ENV=\"/Users/jeremy/mcp/mcp-ssh-manager/.env\" bash -c '\nsource /Users/jeremy/.ssh-manager-cli/lib/config.sh\nsource /Users/jeremy/.ssh-manager-cli/lib/menu.sh\n\n# Test avec un serveur qui n''''existe pas\nserver_name=\"\"efaje_production\"\"\nexisting_host=$(get_server_config \"\"$server_name\"\" \"\"HOST\"\" 2>/dev/null)\nif [ -n \"\"$existing_host\"\" ]; then\n echo \"\"ERREUR: Le serveur est d\\u00e9tect\\u00e9 comme existant\"\"\nelse\n echo \"\"OK: Le serveur n''''est pas d\\u00e9tect\\u00e9 comme existant\"\"\nfi\n\n# Test avec un serveur qui existe\nserver_name=\"\"efaje_staging\"\"\nexisting_host=$(get_server_config \"\"$server_name\"\" \"\"HOST\"\" 2>/dev/null)\nif [ -n \"\"$existing_host\"\" ]; then\n echo \"\"OK: Le serveur efaje_staging est bien d\\u00e9tect\\u00e9 (host: $existing_host)\"\"\nelse\n echo \"\"ERREUR: Le serveur efaje_staging n''''est pas d\\u00e9tect\\u00e9\"\"\nfi\n')",
|
|
62
|
-
"Bash(git init:*)",
|
|
63
|
-
"Bash(./build.sh:*)",
|
|
64
|
-
"Bash(SSH_MANAGER_ENV=\"/Users/jeremy/mcp/mcp-ssh-manager/.env\" /Users/jeremy/.ssh-manager-cli/ssh-manager --version)",
|
|
65
|
-
"Bash(git tag:*)",
|
|
66
|
-
"Bash(readlink:*)",
|
|
67
|
-
"Bash(SSH_MANAGER_ENV=\"/Users/jeremy/mcp/mcp-ssh-manager/.env\" bash -c '\nsource /Users/jeremy/.ssh-manager-cli/lib/config.sh\nserver=\"\"efaje_prod\"\"\nhost=$(get_server_config \"\"$server\"\" \"\"HOST\"\")\nif [ -n \"\"$host\"\" ]; then\n echo \"\"Server detected with host: $host\"\"\nelse\n echo \"\"Server not detected (host is empty)\"\"\nfi\n')",
|
|
68
|
-
"Bash(npm start:*)",
|
|
69
|
-
"Bash(ssh:*)",
|
|
70
|
-
"Bash(npm run build:*)",
|
|
71
|
-
"Read(//Users/jeremy/.ssh/**)",
|
|
72
|
-
"Read(//Users/jeremy/.codex/**)",
|
|
73
|
-
"Read(//Users/jeremy/.config/claude-code/**)",
|
|
74
|
-
"Bash(SSH_MANAGER_ENV=\"/Users/jeremy/mcp/mcp-ssh-manager/.env\" /Users/jeremy/.ssh-manager-cli/ssh-manager codex)",
|
|
75
|
-
"Bash(SSH_MANAGER_ENV=\"/Users/jeremy/mcp/mcp-ssh-manager/.env\" /Users/jeremy/.ssh-manager-cli/ssh-manager codex setup)",
|
|
76
|
-
"Bash(SSH_MANAGER_ENV=\"/Users/jeremy/mcp/mcp-ssh-manager/.env\" /Users/jeremy/.ssh-manager-cli/ssh-manager codex migrate)",
|
|
77
|
-
"Bash(SSH_MANAGER_ENV=\"/Users/jeremy/mcp/mcp-ssh-manager/.env\" /Users/jeremy/.ssh-manager-cli/ssh-manager codex test)",
|
|
78
|
-
"Bash(SSH_CONFIG_PATH=/Users/jeremy/.codex/ssh-config.toml node --check src/index.js)",
|
|
79
|
-
"Bash(ssh-manager:*)",
|
|
80
|
-
"Bash(npm whoami:*)",
|
|
81
|
-
"Bash(npm view:*)",
|
|
82
|
-
"Bash(npm pack:*)",
|
|
83
|
-
"Bash(npm publish:*)",
|
|
84
|
-
"Bash(git rm:*)",
|
|
85
|
-
"Bash(while read line_num rest)",
|
|
86
|
-
"Bash(do sed -n \"$line_nums/.*''''\\([^'''']*\\)''''.*/\\1/p\" /Users/jeremy/mcp/mcp-ssh-manager/src/index.js done)",
|
|
87
|
-
"Bash(sed:*)",
|
|
88
|
-
"Bash(perl:*)",
|
|
89
|
-
"Bash(git fetch:*)",
|
|
90
|
-
"Bash(git -C /Users/jeremy/mcp/mcp-ssh-manager log:*)",
|
|
91
|
-
"WebFetch(domain:www.npmjs.com)",
|
|
92
|
-
"WebFetch(domain:glama.ai)"
|
|
93
|
-
],
|
|
94
|
-
"deny": []
|
|
95
|
-
}
|
|
96
|
-
}
|