If you regularly work with a remote Linux server, cloud machine, or another computer, SSH (Secure Shell) gives you a secure way to manage that system from your own PC. But SSH is not just for running commands remotely. You can also use it to transfer files securely between computers.
Whether you need to upload a website file, download a configuration file, move documents to a server, or copy an entire folder, SSH provides several convenient options. The three most common methods are SCP, SFTP, and Rsync.
In this guide, you’ll learn how each method works, what commands to use, and when each option makes the most sense.
The examples focus on Windows and Linux users, but the same basic SSH commands work on macOS and other Unix-based systems.
How Does File Transfer Over SSH Work?
SSH creates an encrypted connection between your computer and the remote system. Instead of sending files through an unsecured connection, your data travels through the SSH connection, helping protect the contents and login credentials while they are being transferred.
For example, suppose your remote server has the IP address 192.168.1.50, your username is john, and you want to upload a file called report.pdf. Depending on the method you choose, you could transfer it with SCP, browse and transfer it through SFTP, or synchronize it with Rsync.
Before starting, make sure SSH is enabled on the remote computer and that you know its IP address or hostname, username, and authentication method.
Transferring Files Over SSH [3 Simple Ways in Detail]

Featured Snippet: To transfer files over SSH, you can use SCP, SFTP, or Rsync. SCP is useful for quickly copying individual files or folders, SFTP provides an interactive file-transfer experience, and Rsync is ideal for efficiently synchronizing large numbers of files. Each method requires an SSH server, a remote username, the server’s IP address or hostname, and valid authentication credentials.
Let’s learn all the methods one by one!
1: Transfer Files Using SCP
SCP (Secure Copy Protocol) is one of the simplest ways to transfer files through SSH. It is particularly useful when you want to copy a specific file or folder without opening an interactive session.
On Windows 10 and Windows 11, modern versions of the operating system generally include the OpenSSH Client. You can check whether SSH is available by opening Windows Terminal or Command Prompt and entering ssh. If Windows recognizes the command, you can use SCP from the same terminal.
To upload a file from your computer to a remote server, use this format:
scp filename username@server_ip:/remote/path/
For example, if you want to upload report.pdf to the /home/john/documents/ directory, enter:
scp report.pdf john@192.168.1.50:/home/john/documents/
Windows will ask for the remote account’s password if password authentication is enabled. After successful authentication, SCP copies the file to the specified location.
To download a file from the remote computer to your local machine, reverse the source and destination:
scp username@server_ip:/remote/path/filename .
For example:
scp john@192.168.1.50:/home/john/documents/report.pdf .
The period at the end means the file should be copied to your current directory.
You can also transfer an entire folder by adding the -r option:
scp -r myfolder john@192.168.1.50:/home/john/
SCP is a great choice when you want a quick, straightforward file transfer and don’t need advanced synchronization features.
2: Transfer Files Using SFTP
SFTP (SSH File Transfer Protocol) is another secure method for moving files. Unlike SCP, SFTP gives you an interactive command-line environment where you can navigate directories, upload files, download files, rename files, and create directories.
Open Windows Terminal, Command Prompt, PowerShell, or a Linux terminal and connect with:
sftp username@server_ip
For example:
sftp john@192.168.1.50
After authentication, you’ll see an SFTP prompt. You can check the contents of the remote directory by entering:
ls
To see files on your own computer, use:
lls
To upload a local file, use the put command:
put report.pdf
To download a remote file, use:
get report.pdf
You can also upload an entire directory with:
put -r myfolder
If you need to move around the remote system, use:
cd /home/john/documents/
You can change your local directory with:
lcd C:\Users\John\Documents
When you’re finished transferring files, enter:
exit
SFTP is especially useful when you’re working with multiple files and want more control over where files are located. It also feels more like working with a basic file manager while still operating from the terminal.
For users who prefer a graphical interface, applications such as WinSCP can provide a visual way to connect through SFTP without manually typing every transfer command.
3: Transfer Files Using Rsync
Rsync is the best option when you’re transferring large directories or repeatedly synchronizing files between computers. Instead of blindly copying everything every time, Rsync can compare files and transfer only the data that needs to be updated.
On a Linux system where Rsync is installed, a basic transfer looks like this:
rsync -avz myfolder/ username@server_ip:/home/john/myfolder/
Here, -a enables archive mode, -v provides more detailed output, and -z compresses data during transmission.
To download a remote directory to your local computer, reverse the source and destination:
rsync -avz username@server_ip:/home/john/myfolder/ ./myfolder/
One important detail is the trailing slash. For example, myfolder/ generally means “copy the contents of this folder,” while myfolder can produce different directory behavior depending on the destination.
Rsync becomes particularly valuable for backups, website deployments, large projects, and repeated file synchronization. If you transfer a 10 GB folder and only a few files changed, Rsync can avoid retransferring unchanged data.
Windows users may need to install an appropriate Rsync implementation, such as using a Linux environment through WSL, before using Rsync commands natively.
Verify the Transferred Files
After transferring files, it’s a good idea to verify that the files arrived correctly. For a simple transfer, you can connect to the remote machine with SSH and use commands such as ls to confirm that the file exists.
For example:
ssh john@192.168.1.50
Then navigate to the destination:
cd /home/john/documents/
Run:
ls -lh
The output lets you check the filename and file size.
For important files, you can also compare checksums using tools such as SHA-256. This gives you additional confidence that the transferred file matches the original.
FAQs
Is SSH required for SCP and SFTP?
Yes. SCP and SFTP use SSH to establish the secure connection. The remote computer must have an SSH server running and accessible to your computer.
Which is better, SCP or SFTP?
For quick one-time transfers, SCP is usually simpler. SFTP is better when you need to browse directories, transfer multiple files, rename files, or perform several file-management tasks during the same connection.
Is Rsync faster than SCP?
Rsync can be much more efficient when you’re synchronizing files repeatedly, because it can transfer only changed data instead of copying everything again.
Can I transfer files over SSH on Windows 11?
Yes. Windows 11 supports OpenSSH Client, allowing you to use commands such as ssh, scp, and sftp from Windows Terminal or PowerShell when the required components are installed.
Can I transfer folders over SSH?
Yes. SCP and SFTP can transfer directories recursively, while Rsync is specifically designed to synchronize directory structures efficiently.
Summary
Transferring files over SSH doesn’t have to be complicated. SCP is a simple choice for quickly copying files and folders, SFTP is useful when you want interactive control over remote files, and Rsync is ideal for large or repeated synchronization tasks.
For beginners, start with SCP for straightforward transfers. Move to SFTP when you need more control over remote directories, and consider Rsync when you’re regularly synchronizing large amounts of data.
Whichever method you choose, SSH provides an encrypted and secure connection for transferring your files.