> For the complete documentation index, see [llms.txt](https://wiki.datadike.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.datadike.com/pam/administration/sessions/file-transfer.md).

# File transfer

The four ways files move between a user's workstation and a protected asset — in-browser explorer, bulk upload, an external SFTP client, and the CLI — and what each one records.

## What this is and when to use it

Files reach a protected asset through the solution, not around it. Every path below carries the same two properties: the user never holds the asset's credential, and every upload and download is written to the audit trail with a retrievable copy of the file.

On Linux assets the transfer runs over **SFTP**, and by default it uses the same port as SSH — port **22** on the asset.

Four paths exist, and they are not interchangeable:

| Method                   | Where                        | Upload                  | Download | Reach                                   |
| ------------------------ | ---------------------------- | ----------------------- | -------- | --------------------------------------- |
| **File explorer**        | Browser, new tab             | Yes                     | Yes      | Any directory the account has rights to |
| **File transfer** (bulk) | Browser, console page        | Yes, many files at once | **No**   | `/tmp/` only                            |
| **SFTP client**          | FileZilla, WinSCP, MobaXterm | Yes                     | Yes      | Any directory the account has rights to |
| **SFTP over CLI**        | Terminal                     | Yes                     | Yes      | Any directory the account has rights to |

{% hint style="warning" %}
Two different ports are involved and confusing them is the most common mistake here. Port **22** is the asset's own SSH/SFTP port, used by the solution to reach the target. Port **2222** is the solution's own SFTP listener, which is what an external client connects to. An SFTP client pointed at port 22 of the PAM address will not work.
{% endhint %}

## Before you start

* The user needs the **Transfer** actions in the authorization rule that grants them the asset: **Upload**, **Download**, and **Delete** are granted separately. Without them the connection succeeds and the file operation is refused. See [Authorizations](https://wiki.datadike.com/pam/administration/access/authorizations.md).
* The asset's SFTP port must be reachable from the solution.
* An account on the asset with filesystem rights to the directories in question. The solution enforces its own permissions on top of the operating system's; it does not override them.

## In-browser file explorer

The fullest option: a file manager with free navigation, upload, and download.

There are two ways in, and they land in the same place:

* From the device access list, right-click the asset, choose to connect, select the **SFTP** protocol, pick the account, set the connection method to **Web**, and click **Connect**.
* From **Cockpit › File explorer**, then expand the asset tree in the **Places** sidebar on the left and select the device.

Once the explorer is open:

* **Upload** — navigate to the destination directory, then either drag files into the main panel, or right-click an empty area of the file panel and choose **Upload files**.
* **Download** — right-click the file and choose **Download**, or double-click it.

## Bulk upload

Use **Cockpit › File transfer** when you need to push many files to many assets at once and do not need to retrieve anything.

1. Open **Cockpit › File transfer**.
2. In the **Asset tree** on the right, select the target asset from the list of available devices.
3. In **Account information**, enter or select the account the transfer will run as.
4. Check **Upload to directory**. It shows `/tmp/` and it is fixed.
5. Drag the files into the upload area, or use **click here to upload** to pick them from your workstation.
6. Click **Transfer**.
7. Watch the **Pending** section, which lists each file with its success or failure status.

{% hint style="warning" %}
This method **uploads only** — there is no download. And the destination is locked to `/tmp/` on the asset; you cannot choose another directory. If you need a different path, or you need to fetch a file, use the file explorer instead.
{% endhint %}

{% hint style="info" %}
Each file may be up to **200 MB**. The underlying limit is the `CLIENT_MAX_BODY_SIZE` parameter, whose default is `4096m`; raising or lowering the per-file ceiling is a change to the deployment, so ask the vendor before relying on a different value.
{% endhint %}

## External SFTP client

Point any SFTP client at the solution itself rather than at the asset. You authenticate with your **own** PAM credentials — never the asset's — and MFA is requested if it is enabled on your profile. What you then see is a directory tree of the assets and accounts available to you: navigate to the target server, pick the account, and transfer normally.

| Parameter    | Value                     |
| ------------ | ------------------------- |
| **Protocol** | SFTP                      |
| **Host**     | The solution's IP address |
| **Port**     | 2222                      |
| **User**     | Your PAM username         |
| **Password** | Your PAM password         |

* **FileZilla** — enter `sftp://<PAM_IP>` as the host, port `2222`, your PAM username and password, then **Quickconnect**. Transfer by drag-and-drop.
* **WinSCP** — protocol **SFTP**, host the PAM address, port `2222`, your PAM credentials, then **Login**.
* **MobaXterm** — the SFTP panel appears automatically on the left when you connect, so files can be dragged in either direction.

### From the command line

```
sftp -P 2222 user@pam_address
```

| Command     | Action             |
| ----------- | ------------------ |
| `ls`        | List files         |
| `cd dir`    | Change directory   |
| `get file`  | Download a file    |
| `put file`  | Upload a file      |
| `rm file`   | Delete a file      |
| `mkdir dir` | Create a directory |

## File conflict strategy

When a file of the same name already exists at the destination, the behaviour is a per-user preference set under **Personal settings › Preferences › File conflict strategy**:

| Strategy      | Result                                         |
| ------------- | ---------------------------------------------- |
| **Overwrite** | Replaces the existing file                     |
| **Skip**      | Keeps the original, discards the incoming file |
| **Rename**    | Keeps both; the incoming file gets a suffix    |

## How to verify it worked

Do not trust the progress indicator alone — it confirms the upload reached the solution, not that the file landed on the asset.

1. Open **Audit › File transfers**. The transfer must appear as its own record, with the user, the asset, the account used, the operation (**Upload** or **Download**), and the file name.
2. Use the record's action button to **download a copy of the transferred file**, and confirm it is the file you meant to send. This is the check that proves content, not just intent.
3. For a bulk upload, reconnect through the file explorer and list `/tmp/` on the asset. A file that is absent there but shows as successful in **Pending** points at the destination account's rights, not at the transfer.

A transfer that succeeded but produced no audit record is a finding worth investigating: every method above is supposed to record.

## Common errors

| Symptom                                           | Cause                                                              | Fix                                                                                                       |
| ------------------------------------------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
| Transfer is refused mid-session                   | The **Transfer** actions were not granted in the authorization     | Grant Upload, Download, or Delete as needed on the rule                                                   |
| SFTP client cannot connect at all                 | Pointed at port 22 of the PAM address, or at the asset directly    | Use the PAM address on port **2222**                                                                      |
| Client connects, then rejects the login           | The asset's credential was used instead of your own PAM credential | Authenticate with your PAM username and password; the asset account is chosen afterwards, inside the tree |
| Login is accepted then hangs                      | MFA is enabled on your profile and the prompt was not answered     | Complete the MFA challenge the client presents                                                            |
| No download option anywhere on the screen         | You are on the bulk **File transfer** page, which is upload-only   | Use the **File explorer** instead                                                                         |
| Upload cannot be placed in the intended directory | Bulk transfer is fixed to `/tmp/`                                  | Use the file explorer, which can reach any directory the account has rights to                            |
| Upload fails on a large file                      | The file exceeds the per-file limit, 200 MB by default             | Split the file, or have the limit reviewed for the deployment                                             |
| A file of the same name silently did not change   | The conflict strategy is set to **Skip**                           | Change the strategy to Overwrite or Rename                                                                |

## Related pages

* [Authorizations](https://wiki.datadike.com/pam/administration/access/authorizations.md)
* [Connection methods](https://wiki.datadike.com/pam/administration/sessions/connection-methods.md)
* [Asset inventory](https://wiki.datadike.com/pam/administration/assets/inventory.md)
* [Managed accounts](https://wiki.datadike.com/pam/administration/accounts/managed-accounts.md)
* [Command filtering](https://wiki.datadike.com/pam/administration/access/command-filtering.md)
