SFTP
Contents
SFTP
SFTP stands for SSH File Transfer Protocol. It is a secure way to transfer files over a network. Even though it has "FTP" in its name, SFTP is actually a different protocol that runs over SSH (Secure Shell), not the older FTP.
The main purpose of SFTP is to provide a secure way to copy, move, list, and manage files on a remote computer or server.
How SFTP Works
SFTP works by establishing a connection *inside* an already secure and encrypted SSH connection.
1. You use an SFTP client program to connect to a remote server that is running an SSH server. 2. The SSH connection is established first. This connection is encrypted and secure. 3. Once the SSH connection is active, the SFTP protocol starts running within that secure tunnel. 4. All your file operations (like uploading a file, downloading a file, listing the files in a folder, deleting a file, renaming a file) are sent through this secure SSH tunnel.
Because everything happens *inside* the encrypted SSH tunnel, the data (including your login details and the file content) is protected from being intercepted or read by others on the network.
What Encryption SFTP Uses
SFTP itself doesn't have its own separate encryption. It relies entirely on the **SSH protocol** for encryption and authentication.
SSH uses strong encryption methods (like AES or Triple DES) to scramble the data being sent between your computer and the server. It also uses cryptographic techniques for authentication (verifying your identity, usually with a password or public key) to ensure you are connecting to the correct server and that only authorized users can access the files.
So, when you use SFTP, the security and encryption come from the underlying SSH connection.
SFTP vs. FTP and FTPS
- **FTP (File Transfer Protocol):** This is an older protocol for transferring files. It sends data, including usernames and passwords, in plain text, meaning it is **not secure** and can be easily intercepted.
- **FTPS (FTP over SSL/TLS):** This adds an encryption layer (SSL/TLS, like used by secure websites) to the FTP protocol. It is more secure than plain FTP but can sometimes be more complex to set up with firewalls compared to SFTP.
- **SFTP (SSH File Transfer Protocol):** Runs over SSH. Generally considered very secure and often simpler to use through firewalls than FTPS because it only needs the standard SSH port (usually port 22).
Usage
SFTP is commonly used for:
- Uploading website files to a web server.
- Transferring files to or from a remote server, like a seedbox or VPS.
- Securely backing up files to a remote location.
- Managing files on a remote system from your local computer.
Many file transfer client programs (like FileZilla, WinSCP, Cyberduck) support SFTP, as do command-line tools (like the `sftp` command in Linux and macOS terminals).
See Also
References
- Template:Cite web - Explanation from the company that developed SSH.
- Template:Cite web - Explains the different protocols simply.
- Template:Cite web - Simple explanation.