Add detailed auto-sudo and security docs in all 3 languages
Describe automatic privilege escalation mechanism, password handling via stdin, and AI API security. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
57
README.md
57
README.md
@@ -78,12 +78,29 @@ Add servers via GUI or edit the JSON directly.
|
||||
}
|
||||
```
|
||||
|
||||
### Auto-sudo
|
||||
|
||||
The app automatically handles privilege escalation:
|
||||
|
||||
- If `user: "root"` — commands execute directly, no sudo needed
|
||||
- If `user` is non-root — the app automatically wraps the command in `sudo -S` and feeds the password from `servers.json` via stdin
|
||||
- The password is **never** passed as a command-line argument (invisible in `ps aux`)
|
||||
- You just type the command (e.g. `systemctl restart nginx`) — the app decides whether sudo is needed and handles it
|
||||
- In the GUI terminal, the "sudo" checkbox is enabled by default for non-root users; uncheck it for commands that don't need elevation
|
||||
|
||||
```
|
||||
You type: systemctl restart nginx
|
||||
App executes: sudo -S -p '' bash -c 'systemctl restart nginx'
|
||||
(password fed automatically via stdin from servers.json)
|
||||
```
|
||||
|
||||
### Security
|
||||
|
||||
- `config/servers.json` is in `.gitignore` — never committed
|
||||
- Passwords stored locally only
|
||||
- Passwords stored locally only, **never sent to any AI/API**
|
||||
- SSH keys (ed25519) — recommended auth method
|
||||
- sudo password sent via stdin (not visible in process list)
|
||||
- When used with Claude Code: only alias + command are passed through the AI API, passwords stay in the local JSON file
|
||||
|
||||
### Project Structure
|
||||
|
||||
@@ -159,12 +176,29 @@ python build.py
|
||||
При первом запуске `config/servers.json` создаётся из шаблона.
|
||||
Добавляйте серверы через GUI или редактируйте JSON напрямую.
|
||||
|
||||
### Авто-sudo
|
||||
|
||||
Приложение автоматически повышает привилегии:
|
||||
|
||||
- Если `user: "root"` — команды выполняются напрямую, sudo не нужен
|
||||
- Если пользователь не root — приложение автоматически оборачивает команду в `sudo -S` и само вводит пароль из `servers.json` через stdin
|
||||
- Пароль **никогда** не передаётся как аргумент командной строки (не виден в `ps aux`)
|
||||
- Вы просто вводите команду (например `systemctl restart nginx`) — приложение само решает, нужен sudo или нет, и само всё делает
|
||||
- В GUI-терминале checkbox "sudo" включён по умолчанию для non-root; отключите для команд, не требующих повышения
|
||||
|
||||
```
|
||||
Вы вводите: systemctl restart nginx
|
||||
Приложение делает: sudo -S -p '' bash -c 'systemctl restart nginx'
|
||||
(пароль подставляется автоматически из servers.json через stdin)
|
||||
```
|
||||
|
||||
### Безопасность
|
||||
|
||||
- `config/servers.json` в `.gitignore` — никогда не коммитится
|
||||
- Пароли хранятся только локально
|
||||
- Пароли хранятся только локально, **никогда не передаются в AI/API**
|
||||
- SSH-ключи (ed25519) — рекомендуемый метод аутентификации
|
||||
- sudo-пароль передаётся через stdin (не виден в списке процессов)
|
||||
- При использовании с Claude Code: через API нейронки проходят только alias + команда, пароли остаются в локальном JSON-файле
|
||||
|
||||
---
|
||||
|
||||
@@ -217,12 +251,29 @@ python build.py
|
||||
首次启动时,`config/servers.json` 从模板自动创建。
|
||||
通过GUI添加服务器或直接编辑JSON文件。
|
||||
|
||||
### 自动sudo
|
||||
|
||||
应用自动处理权限提升:
|
||||
|
||||
- 如果 `user: "root"` — 命令直接执行,无需sudo
|
||||
- 如果用户不是root — 应用自动将命令包装在 `sudo -S` 中,并从 `servers.json` 通过stdin自动输入密码
|
||||
- 密码**绝不**作为命令行参数传递(在 `ps aux` 中不可见)
|
||||
- 您只需输入命令(例如 `systemctl restart nginx`)— 应用自动判断是否需要sudo并处理
|
||||
- 在GUI终端中,"sudo"复选框默认为非root用户启用;对于不需要提权的命令可以取消勾选
|
||||
|
||||
```
|
||||
您输入: systemctl restart nginx
|
||||
应用执行: sudo -S -p '' bash -c 'systemctl restart nginx'
|
||||
(密码从servers.json通过stdin自动输入)
|
||||
```
|
||||
|
||||
### 安全性
|
||||
|
||||
- `config/servers.json` 在 `.gitignore` 中 — 永不提交
|
||||
- 密码仅存储在本地
|
||||
- 密码仅存储在本地,**绝不发送到任何AI/API**
|
||||
- SSH密钥(ed25519)— 推荐的认证方式
|
||||
- sudo密码通过stdin传递(在进程列表中不可见)
|
||||
- 与Claude Code配合使用时:只有别名和命令通过AI API传递,密码保留在本地JSON文件中
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user