SFTP
Riversoft® STCP DirectLink exchanges files with partners over SFTP (SSH File Transfer Protocol) in both connection directions: it can connect to the partner’s server or receive the partner’s connection. In both cases, files go both ways in the same connection.
| Component | Who starts the connection | Function |
|---|---|---|
| SFTP connector | Riversoft STCP DirectLink (outbound connection) | Connects to the partner’s SFTP server to send and fetch files. |
| SFTP DirectLink service | The partner (inbound connection) | Receives the partner’s connection, who uploads and downloads files in their own mailbox. |
Outbound connections (SFTP connector)
Send
flowchart LR
subgraph DL[Riversoft STCP DirectLink]
SA["saida directory"] --> C[SFTP connector]
end
C -->|send| P[Partner SFTP server]
Fetch
flowchart LR
subgraph DL[Riversoft STCP DirectLink]
C[SFTP connector] --> EN["entrada directory"]
end
P[Partner SFTP server] -->|fetch| C
Note
Sending and fetching can happen in the same connection: Riversoft STCP DirectLink first sends the files, then fetches the partner’s files. Depending on the mode configured in the user, the connection can also only send or only fetch.
Riversoft STCP DirectLink connects to the partner’s server by schedule, or when the operator starts the connection in the Riversoft Console Portal. In the same connection, it:
- sends the files available to the partner in the user’s mailbox (
saidadirectory); - fetches the partner’s files from the agreed directory and writes them to the
entradadirectory of the mailbox.
| Step | Behavior |
|---|---|
| Send | The file is written with a temporary name (temporary directory or extension, when configured) and renamed at the end. If the partner’s server already has a file with the same name, it may refuse the rename: Riversoft STCP DirectLink does not overwrite partner files. |
| Fetch | Only files matching the configured mask are fetched. |
| After fetching | The file can be copied to a backup directory on the partner’s server and, if configured, removed from the source directory. |
| Network | The connection can go through an HTTP, HTTPS, SOCKS4 or SOCKS5 proxy, and through a specific local address. |
What to agree with the partner
| Item | Description |
|---|---|
| Server | SFTP server address and port. |
| Credential | User and password, or the key pair: the private key stays in Riversoft STCP DirectLink and the public key is given to the partner. |
| Server identity | Fingerprint of the server key, to confirm that the connection is with the right partner. |
| Directories | Where to deliver the files and where to fetch them, with the mask of the files to fetch. |
| Post-processing | Whether fetched files must be removed or moved to backup on the partner’s server. |
These details are registered in the user, in the Riversoft Console Portal, together with the connection schedule.
Inbound connections (SFTP DirectLink service)
Upload by the partner
flowchart LR
subgraph DL[Riversoft STCP DirectLink]
S[SFTP DirectLink service] --> EN["entrada directory"]
end
Q[Partner SFTP client] -->|partner upload| S
Download by the partner
flowchart LR
subgraph DL[Riversoft STCP DirectLink]
SA["saida directory"] --> S[SFTP DirectLink service]
end
S -->|partner download| Q[Partner SFTP client]
Note
Upload and download can happen in the same session: the partner decides which operations to perform while connected.
The partner connects to Riversoft STCP DirectLink with an SFTP client and the user registered for them. In the same session, they can:
- upload files, which arrive in the
entradadirectory of the mailbox; - download the files made available to them in the
saidadirectory.
The partner only sees their own mailbox.
| Authentication | How it works |
|---|---|
| Public key | The partner’s public key is registered in the user. This is the recommended option. |
| Password | Riversoft STCP DirectLink user and password, with the user’s password policies and MFA. |
The SFTP DirectLink service is registered in the instance network services, in the Riversoft Console Portal: address, port, server key and limits on connections and open files.
Security
- Prefer key authentication to password authentication, in both directions.
- Confirm the partner’s server fingerprint before the first exchange.
- Allow the SFTP service port only from the partners’ addresses.
- See the supported algorithms in Security: SFTP.