dsh-remote
提供SSH连接与22个远程工作区操作工具。 适合需要在DSH中通过SSH对远程服务器进行文件操作和部署的开发者。
同名套件的其他儲存庫
安裝
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:flymysql/dsh-remote說明文件
閱讀完整 README ↗配置
| 键 | 类型 | 默认 | 说明 |
|---|---|---|---|
host | string | '' | 默认 SSH 主机(空=断开) |
port | int | 22 | 默认 SSH 端口 |
username | string | '' | 默认 SSH 用户 |
password | string | '' | 默认 SSH 密码(非空覆盖 key) |
privateKeyPath | string | '' | 私钥路径(仅在显式提供时使用) |
passphrase | string | '' | 加密私钥的 passphrase |
workspace | string | '' | 默认远程工作区路径 |
shell | string | '' | 远程命令终端策略:''=自动检测(Windows 找 Git Bash)、'git-bash'=优先 Git Bash、'native'=不包装、其他=显式 bash.exe 路径(如 C:\Program Files\Git\bin\bash.exe) |
commandTimeoutMs | int | 20000 | 单条远程命令超时 |
connectTimeoutMs | int | 15000 | SSH 连接超时 |
maxOutputChars | int | 200000 | 单条远程命令捕获的 stdout/stderr 上限 |
maxFileBytes | int | 52428800 | 镜像同步时跳过超过该大小的文件(0=不设上限) |
hostKeyMode | string | accept-new | 主机指纹策略:accept-new(首次信任)、verify(拒绝未知主机)、off(跳过校验) |
useAgent | bool | false | 用 OpenSSH agent(SSH_AUTH_SOCK)认证 |
keyboardInteractive | bool | false | 允许 keyboard-interactive 认证(OTP/MFA)并复用配置的密码 |
backend | string | native | SSH 传输后端(issue #51)。native=内置 ssh2(密码/私钥/agent/动态码);openssh=调用本机 ssh 命令,因此支持 GSSAPI/Kerberos(kinit 后免密)以及 ProxyCommand、PKCS11Provider、Match 等 OpenSSH 专有特性。可按机器单独设置。代价:每条命令新建一次连接(比 native 慢);SFTP 仍复用单条长连接。主机名会被原样交给 ssh(~/.ssh/config 是配置唯一来源),主机密钥也由 ssh 用你自己的 known_hosts 校验 |
sshBinary | string | '' | openssh 后端调用的 ssh 可执行文件(留空=用 PATH 里的 ssh) |
proxy | object | — | 跳板机:{ host, port?, username?, password?, privateKeyPath? };语义是「在跳板机上连目标 host:port」,所以也能用来连跳板机上 docker 容器的 sshd(见「常见问题」里的 issue #56) |
autoPush | bool | false | 镜像内文件被编辑后自动推回远端(watcher,带防抖) |
auditLog | bool | true | 把执行的命令追加到 $DSH_HOME/remote-workspaces/audit.log |
encoding | string | utf-8 | 远程文件读写的文本编码(如 gbk) |
fileReference | bool | true | 远程 @ 补全:远程会话的 @ 列出远端目录树(issue #39);关闭则只有本地镜像 |
fileReferenceMaxResults | int | 20 | 一次 @ 查询最多返回多少候选 |
fileReferenceMaxEntries | int | 3000 | 一棵远程工作区索引最多保留多少条目 |
fileReferenceExcludedDirectories | string[] | [.git, node_modules, dist, build, out, coverage, target, .next, .nuxt, .turbo, .venv, __pycache__, .pytest_cache, .mypy_cache, .gradle] | 远程 @ 遍历跳过的目录名 |
fileReferenceTimeoutMs | int | 4000 | 一次远程索引遍历的墙钟预算(超时用已扫到的部分结果,不让光标等) |
searchTimeoutMs | int | 60000 | rw_search 的协作式预算(ms):既作为工具声明的 timeoutMs 交给 DSH 的 timeout-policy,也是搜索自身的墙钟上限;到点返回部分结果并标 TRUNCATED(issue #44)。 |
searchMaxEntries | int | 50000 | rw_search 在返回部分结果前最多扫描多少个文件。 |
updateMode | string | auto | 自更新模式:auto=加载时及每 6 小时检查并自动应用、manual=仅在手动检查时查、off=完全不查。0.8.27 起默认 auto——之所以现在才安全,是因为 0.8.24 补上了宿主半热切换 |
updateCheckIntervalMs | int | 21600000(6h) | auto 模式检查 npm 的间隔(下限 60000) |
updateAutoReload | bool | true | 更新落地后自动热切换宿主半;false 则留到下次启动,设置页会显示 pendingReload |
webAttachPortStart | int | 3088 | 「远程 DSH 界面」在本机监听的起始端口(占用则顺延,仅监听 127.0.0.1) |
webAttachCommand | string | dsh | 在远端启动 dsh web 用的命令;远端 dsh 不在 SSH 登录 PATH 时改这里(也可按机器在设置页「高级」里单独设,机器级优先) |
webAttachDshHome | string | '' | 远端启动时导出的 DSH_HOME;留空则复用远端用户自己的 harness home |
webAttachWaitSeconds | int | 45 | 等待远端 dsh web 打印启动令牌的秒数 |
webInstallPrefix | string | '' | 自动部署装到远端的哪个目录;留空用 $HOME/.dsh-remote/dsh(不写系统目录、不改 PATH) |
webInstallVersion | string | 0.1.5-rc.2 | 自动部署安装的 dsh 版本;默认值是第一个在 Linux 上能启动 web 的版本 |
webInstallRegistry | string | '' | 安装用的 npm 源;留空沿用远端自己的配置,不会覆盖内网镜像 |
localTools | string | bootstrap | 本地 session(cwd 不在远程镜像里)暴露哪些 rw_* 工具(issue #63):bootstrap=只暴露配置闭环 rw_machines/rw_connect/rw_pick_workspace(其余 19 个在本地 session 必然报 "this session is LOCAL",暴露只是白占 schema);none=完全不暴露 rw_*(远程配置只能走设置页);all=旧的 full 暴露。远程 session(cwd 在镜像里)不受影响,始终全量;非法值按 bootstrap 处理 |
权威清单是
lib/index.js里的Configschema,本表与之一致。