You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per-server command validation via POSIX extended regex (Unix) / glob matching (Windows). Rules are evaluated as: **deny takes priority**. If `deny` matches → rejected. If `allow` is set but doesn't match → rejected.
curl -X PUT http://127.0.0.1:17375/api/profiles/safe-prod \
225
+
-H 'Content-Type: application/json' \
226
+
-d '{"allow":"^(ls|df|uptime|systemctl|apt).*"}'
227
+
```
228
+
229
+
Validation happens in the C daemon before any command reaches SSH — no way to bypass at the CLI or Web UI level.
230
+
231
+
### SFTP File Transfer
232
+
233
+
File upload/download via OpenSSH `sftp` reusing the existing ControlMaster connection (no extra auth). Directories are auto-detected and transferred via tar pipe for efficiency.
234
+
235
+
```bash
236
+
# CLI upload (single file)
237
+
./sshc upload prod ./app.tar.gz /opt/app.tar.gz
238
+
239
+
# CLI upload (directory → auto tar pipe)
240
+
./sshc upload prod ./my-project/ /opt/my-project/
241
+
242
+
# CLI download
243
+
./sshc download prod /var/log/syslog ./syslog
244
+
./sshc download prod /opt/data/ ./data-backup/
245
+
246
+
# Web UI: click "上传" / "下载" buttons in server list
247
+
```
248
+
249
+
**Web UI upload API:**
250
+
```bash
251
+
# Upload file (base64 content in JSON)
252
+
curl -X POST http://127.0.0.1:17375/api/upload/prod \
The C daemon automatically detects config file changes via mtime (last-modified timestamp). No daemon restart needed — any changes to `~/.sshc/profiles.json` take effect on the next request. This includes adding/removing servers, changing proxies, and updating allow/deny rules.
0 commit comments