ssh_upload
Copy a local file or directory to a remote server over SSH, atomically renaming the uploaded data and verifying it with sha256 so no half-written file ever appears.
Instructions
Copies a local file or directory to a server. Data lands under a temporary name and takes its place in one rename, verified by sha256 — a half-written file never appears at the target. A directory replaces the target whole, not file by file, and sudo stages in /tmp first, so the machine needs room for a second copy, and setting an owner needs it too. For text you can paste, ssh_file_write is cheaper; piping base64 through ssh_exec truncates silently.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Octal, one value for every file sent. Omit to keep local permissions. | |
| sudo | No | For /etc, /opt and the like. Data stages in /tmp first — the machine needs room for a second copy. Default: false | |
| owner | No | "root:root", every file sent. Needs sudo; without it the answer says it was not applied. | |
| verify | No | sha256 on both sides, per file. "unavailable" = no sha256 on the machine = delivered, not broken. Default: true | |
| profile | Yes | Machine name. | |
| timeout | No | Milliseconds. No ceiling by default — a transfer runs as long as it takes. | |
| overwrite | No | false = refuse rather than replace, including when the target cannot be checked. A directory is judged whole, not per file. Default: true | |
| recursive | No | Only to force it — a directory is recognised on its own. | |
| local_path | Yes | A file or a directory on this machine. | |
| remote_path | Yes | Where it goes on the server. A sent directory becomes this path itself and replaces it whole, not file by file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | ||
| legend | No | What the words in this answer mean. A key names the field before the value — "state=limited", "jobs[].state=lost" — and only the values this answer actually used are listed. |