T06 · System Persistence
- Location
scripts/remote_train.py:480- Finding
Persistent Passwordless SSH Access Installed on Remote Systems
- Content
View full analysis
/dev/null || " f"(echo '{pub_key_b64}' >> ~/.ssh/.deepspeed_setup_marker && " f"echo '{pub_key_b64}' | base64 -d >> ~/.ssh/authorized_keys)" ) ``` ### Technical Analysis The `setup-keys` workflow generates an SSH private key with an empty passphrase and appends its public key to the remote account's `~/.ssh/authorized_keys`. This creates an authorization mechanism that remains valid after the training process and SSH ControlMaster session have ended. The operation is related to remote training, but it exceeds the minimum access duration required to launch or monitor an individual training job. The `s ...[truncated 1434 chars]- Remediation
View remediation
"` - `command=""` - `no-agent-forwarding` - `no-port-forwarding` - `no-X11-forwarding` - `no-pty` 7. Prefer an existing user-managed SSH agent or credential rather than creating a new persistent identity. 8. Add a dedicated cleanup command that reliably removes both the public key and `.deepspeed_setup_marker`. 9. Avoid using a privileged remote account when a dedicated, restricted training account is sufficient. ]]>
