To transfer files securely, you can use the following methods:
1. SFTP (Secure File Transfer Protocol)
SFTP is a secure version of FTP that uses SSH to encrypt the data being transferred.
Usage Example:
sftp username@remote_host
put local_file.txt
get remote_file.txt
2. SCP (Secure Copy Protocol)
SCP is a command-line utility that allows you to securely transfer files between a local machine and a remote server or between two remote servers using SSH.
Usage Example:
To copy a file from your local machine to a remote server:
scp local_file.txt username@remote_host:/path/to/destination/
To copy a file from a remote server to your local machine:
scp username@remote_host:/path/to/remote_file.txt /local/destination/
3. FTPS (FTP Secure)
FTPS is an extension of FTP that adds support for the Transport Layer Security (TLS) and the Secure Sockets Layer (SSL) cryptographic protocols.
Usage Example:
You would typically use an FTP client that supports FTPS, such as FileZilla, and configure it to connect using FTPS.
4. rsync with SSH
rsync can be used to securely transfer files over SSH, providing both encryption and efficient file transfer.
Usage Example:
rsync -avz -e ssh local_file.txt username@remote_host:/path/to/destination/
Summary
Using SFTP, SCP, FTPS, or rsync with SSH ensures that your file transfers are secure and encrypted, protecting your data from unauthorized access during transmission.
