# SFTP

The pinned **SFTP** tab is a dual-pane file manager. Each pane shows either **This device** or any saved host, so you can copy between your computer and a server — or between two servers.

## Browsing

1. Open the SFTP tab (or choose **Open in SFTP** on a host).
2. In each pane, **Choose a location**: this device or a host. The pane opens in the host's configured SFTP start path, or the home directory.
3. Navigate with double-click, **Back**/**Forward**, the path bar and **Refresh**. **Filter** the listing and toggle **hidden files**.

Per host or group you can set the **start path**, whether **hidden files** are shown, and whether **symlinks are followed**.

## Selecting files

Each list works like a desktop file manager:

- **Click** selects one entry, <kbd>Mod</kbd>+click adds or removes one, and <kbd>Shift</kbd>+click selects everything from the last clicked entry.
- <kbd>Mod</kbd>+<kbd>A</kbd> selects all (also **Actions → Select all**), <kbd>Esc</kbd> clears the selection, and clicking the empty area below the list does too.
- With the list focused, <kbd>↑</kbd>/<kbd>↓</kbd>, <kbd>Home</kbd>/<kbd>End</kbd> and <kbd>PgUp</kbd>/<kbd>PgDn</kbd> move through it and <kbd>Shift</kbd> extends the selection. See [Keyboard shortcuts](./keyboard-shortcuts.md#sftp) for the rest.
- On touch screens, **long-press** an entry to start selecting; then tap entries to add or remove them. Tapping a folder otherwise opens it.

The bar at the bottom of each pane shows how many entries are selected and has buttons to copy them to the other pane, delete them, open the full menu (**More actions**) and clear the selection.

## File operations

Right-click (or use **Actions**) for **Open**, **Download**, **Upload to …** / **Download to this device** (copy to the other pane), **Rename**, **New folder**, **Delete** and **Permissions…** (octal, for example `644`). Right-clicking a selected entry acts on the whole selection; right-clicking any other entry selects just that one first.

Deleting asks once for the whole selection and lists what will go. Deleting a folder is recursive but **never follows symbolic links**, so a link to `/` cannot take your system with it.

## Drag and drop

Drag one entry, or everything selected, and drop it:

| Drop onto                                          | What happens                                                      |
| -------------------------------------------------- | ----------------------------------------------------------------- |
| A folder in the same pane                          | **Moves** the entries into it (a rename on the server)            |
| A folder of the path bar in the same pane          | **Moves** them up into that folder                                |
| The other pane, one of its folders or its path bar | **Copies** them there (upload, download or server-to-server copy) |

The target is highlighted while you drag, and the label next to the pointer shows how many entries you are dragging and whether they will be moved or copied. A folder cannot be dropped onto itself or into one of its own subfolders, and dropping entries onto the folder they are already in does nothing. Press <kbd>Esc</kbd> to cancel a drag. SFTP has no server-side copy, so drags within a pane always move and drags between panes always copy.

### From your file manager

Drag files and folders from Windows Explorer, Finder or your Linux file manager onto a pane, or onto one of its folders, to upload them there. Folders are uploaded with everything in them, through the same transfer queue. Dragging files out of Vaultport into your file manager is not supported yet; use **Download** or the local pane instead. This is a desktop feature; phones and tablets have no drag-in from other apps.

### Name conflicts

If entries with the same names already exist in the target folder, Vaultport lists them and asks whether to **Keep both** (the new copy is named `name (1).ext`), **Overwrite** (files are replaced, folders merged) or **Skip** them. Moves offer only **Keep both** and **Skip**; they never replace anything.

## Transfers

Drag files between the panes — or select them and choose **Upload to …** / **Download to this device** — to queue a transfer. The transfer list shows the state and progress of every item; you can cancel a transfer, and **Clear finished** tidies the list. The panes refresh when a transfer finishes.

- Transfers run in parallel (with a concurrency limit) and pipeline SFTP requests for speed.
- Data is written to a temporary `<name>.sshc-part` file and renamed when complete, so an interrupted transfer never leaves a truncated file under the real name.
- An interrupted transfer is **resumed** from where it stopped if the partial file still matches the source.
- Folders are copied recursively. Server-to-server copies are streamed through your device.
- File names received from a server are validated before they are used locally; entries such as `../../.bashrc` are dropped and reported, so a malicious server cannot write outside the target folder.

## Edit locally

**Edit locally** downloads a remote file into a private temporary folder (mode `0700`, files `0600`) and opens it with your default application. When you save, Vaultport notices the change and offers to upload it.

- The upload **refuses to overwrite** the remote file if it changed on the server since you opened it, so you do not clobber someone else's edit.
- Remote permissions are preserved, and the upload uses the same part-file-and-rename approach.
- The temporary copy is removed when the edit session ends.

Change detection is available in the desktop apps.

## Connections

SFTP panes and transfers reuse a pooled SSH connection per host — including its jump hosts, proxy and credentials — instead of logging in again for every operation.
