Sandbox
ssh()
| Type | Description |
|---|---|
SandboxSshOps | SSH client and server helpers |
SandboxSshOps
connect()
| Name | Type | Description |
|---|---|---|
| user | str | SSH login user |
| term | str | None | Terminal name for interactive sessions |
| sftp | bool | Enable or disable SFTP on the internal server |
| Type | Description |
|---|---|
SshClient | Native SSH client session |
server()
| Name | Type | Description |
|---|---|---|
| host_key_path | str | os.PathLike[str] | None | Override the host private key path |
| authorized_keys_path | str | os.PathLike[str] | None | Override the authorized-keys path |
| user | str | None | Override the guest user used for exec requests |
| sftp | bool | Enable or disable SFTP |
| Type | Description |
|---|---|
SshServer | Server endpoint |
SshClient
exec()
| Name | Type | Description |
|---|---|---|
| command | str | Command string sent through SSH |
| tty | bool | Request a PTY for the exec channel |
| Type | Description |
|---|---|
SshOutput | Captured output and status |
attach()
| Name | Type | Description |
|---|---|---|
| term | str | None | Terminal name for the shell |
| detach_keys | str | None | Detach key sequence |
| Type | Description |
|---|---|
int | Exit code |
sftp()
| Type | Description |
|---|---|
SftpClient | SFTP client session |
close()
SftpClient
| Method | Returns | Description |
|---|---|---|
| read(path) | bytes | Read a file into memory |
| write(path, data) | None | Create or truncate a file |
| mkdir(path) | None | Create a directory |
| remove_file(path) | None | Remove a file |
| remove_dir(path) | None | Remove an empty directory |
| rename(old_path, new_path) | None | Rename a file or directory |
| real_path(path) | str | Resolve a canonical path |
| read_link(path) | str | Read a symlink target |
| symlink(target, link_path) | None | Create a symlink |
| close() | None | Close the SFTP session |
SshServer
serve_connection()
close()
Types
SshOutput
| Property | Type | Description |
|---|---|---|
| status | int | Exit status code |
| success | bool | True if status is 0 |
| stdout_text | str | Captured stdout decoded as UTF-8 |
| stderr_text | str | Captured stderr decoded as UTF-8 |
| stdout_bytes | bytes | Captured stdout bytes |
| stderr_bytes | bytes | Captured stderr bytes |