> For the complete documentation index, see [llms.txt](https://kb.rport.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.rport.io/using-the-remote-access/scp-sftp-through-a-tunnel.md).

# Scp,sftp through a tunnel

### Prerequisites

Copying files to a remote system over scp or sftp requires an SSH server running on the remote side. On almost all Linux systems SSH is installed and active.&#x20;

Create a tunnel for SSH access to the remote server. The tunnel will end on a random port on your rport server. Remember the port number.

![Get the port number of the tunnel](/files/0jzIZ6udA9DJTGqobPpr)

### Using scp or rsync

To copy a file to the remote system over the tunnel via scp use

`scp -P <PORT> <LOCAL-FILE> <USER>@<RPORT-SERVER>:<DESTINATION>`

For example:

`scp -P 22708 /etc/hosts hero@rport.example.com:/tmp/`&#x20;

Doing the same over rsync&#x20;

`rsync -e "ssh -p 22708" /etc/hosts hero@rport.example.com:/tmp/`

### Using Filezilla

* Open the site manager of Filezilla.&#x20;
* Create a new site using the "SFTP- SSH File Transfer Protocol.
* Enter the name of the rport server as "Host".
* Enter the port of the tunnel as port for the Filezilla connection

![Use Filezilla for file transfers over a tunnel](/files/mXgrJhq2gMtQ28KrZU2a)
