> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deepest.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Transfer files with SFTP

> Upload and download files over the Computer's existing SSH authorization, with explicit verification and recovery.

Deepest Computers support SFTP over their standard SSH endpoint. Use it to bring source files into a Computer, download build artifacts, or export data before deleting a Machine. SFTP uses the same per-Computer public-key authorization as SSH.

This is a standard client workflow. There is no separate Deepest file-transfer token or public file API, and no automatic synchronization between your local files and the Computer.

## Prepare the connection

Complete [SSH setup](https://docs.deepest.dev/connect/ssh.md): authorize your public key on the target Computer, Start it if needed, and retrieve its current `host`, `port`, and `user`. Keep the private key on your local computer.

From your **local** terminal:

```bash theme={null}
sftp -i "$HOME/.ssh/deepest_ed25519" -o IdentitiesOnly=yes \
  -P <SSH_PORT> <SSH_USER>@<SSH_HOST>
```

SFTP uses uppercase `-P` for the port. The lowercase `-p` option has another meaning. If you configured the SSH alias from the SSH guide, `sftp deepest-work` uses those same settings.

Expect an interactive `sftp>` prompt. Apply the same host-key checks as for SSH.

## Upload and read back one file

Use a directory and filename you own; the following example uses `report.txt`. At the SFTP prompt:

```text theme={null}
lpwd
pwd
lcd <LOCAL_DIRECTORY>
put report.txt /root/report.txt
get /root/report.txt downloaded-report.txt
bye
```

`lcd` changes the local directory inside the SFTP client; it does not change the parent terminal's working directory after `bye`. `put` sends a local file to the remote path; `get` receives a remote file. Replace `<LOCAL_DIRECTORY>` with the same intended local path in both the transfer and verification steps. The `/root` destination is appropriate for the Developer Image's root user; use a writable directory for the user returned by your endpoint.

For an integrity check with Python 3 available locally, explicitly enter that same local directory, then compare the source and downloaded copy:

```bash theme={null}
cd '<LOCAL_DIRECTORY>' &&
  python3 -c 'import hashlib,pathlib; print(hashlib.sha256(pathlib.Path("report.txt").read_bytes()).hexdigest()); print(hashlib.sha256(pathlib.Path("downloaded-report.txt").read_bytes()).hexdigest())'
```

Matching hashes establish that those file bytes match. They do not prove that a database export is transactionally consistent or that executable content is safe.

For directories, use the client's recursive transfer support:

```text theme={null}
put -r project /root/project-copy
get -r /root/build-artifacts ./build-artifacts
```

Check the destination first. Uploading to an existing path can overwrite data. An Agent should obtain the intended source, destination, and overwrite permission before transferring into an established project.

## Batch a repeatable transfer

Create a local batch file with only the operations you intend:

```text theme={null}
put report.txt /root/report.txt
get /root/report.txt downloaded-report.txt
```

Save it as `transfer.sftp`, then run:

```bash theme={null}
sftp -b transfer.sftp -i "$HOME/.ssh/deepest_ed25519" \
  -o IdentitiesOnly=yes -P <SSH_PORT> <SSH_USER>@<SSH_HOST>
```

Arrange local key access through your SSH agent or another authorized client mechanism. Do not put a private-key passphrase into the batch file.

Check the command's exit status, inspect the destination, and compare sizes or hashes when correctness matters. Do not interpret a missing response as proof that an upload did not occur.

## Lifecycle and resource effects

Files uploaded to a Computer's disk survive a normal Stop/Start. Stop interrupts active transfer connections, and Delete removes the Computer's stored data. Export and verify important files before a destructive action.

Transfer activity requires a Running Computer and therefore consumes running memory and shared CPU. Uploaded files consume Account storage. Guest filesystem free space and Account storage are different observations; a successful file deletion may not immediately release Account storage while snapshots retain blocks. See [Storage reclaim](https://docs.deepest.dev/computers/storage-reclaim.md).

Key revocation blocks new SFTP connections under that grant. It is not a promise to terminate an already established transfer. A Clone does not inherit the source Computer's Deepest SSH grants.

## Recover safely

| Symptom | Likely issue | Next action |
| - | - | - |
| Login refused | Wrong private key, revoked grant, wrong endpoint or stopped Computer | Recheck the SSH guide and retrieve the endpoint |
| Permission denied on a path | Guest file ownership or an unwritable directory | Choose an authorized destination; do not change broad permissions blindly |
| File not found | Confused local/remote paths | Compare `lpwd`, `pwd`, `lls` and `ls` |
| Interrupted upload/download | Network loss or Computer Stop | Inspect the partial target before retrying; verify the finished file |
| No space / write failure | Guest disk or Account storage pressure | Inspect space, remove only known disposable data, then follow storage recovery |
| Need continuous two-way sync | Outside this transfer workflow | Select and configure a standard sync tool separately; do not assume SFTP syncs automatically |

Deepest documents standard SFTP put/get over the Computer's SSH endpoint. SCP variants, filesystem extensions, and synchronization tools follow their own client and protocol compatibility. For SFTP commands and options, see the official [OpenSSH SFTP manual](https://man.openbsd.org/sftp.1).

For repository work, prefer [Git workflows](https://docs.deepest.dev/environment/git-and-github.md) when version history and review are needed. For an interactive editor, see [VS Code Remote SSH](https://docs.deepest.dev/connect/vscode.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.