sftp
Secure file transfer program using an interactive SSH-based FTP interface.
Synopsis
sftp [OPTION]... [USER@]HOST[:PATH]
Examples
sftp user@host
sftp -P 2222 user@host
sftp -b commands.txt user@host
Common options
| Flag | Description |
|---|---|
| -P | Port number |
| -i | Identity file |
| -b | Batch file with commands |
| -r | Recursively transfer directories |
About sftp
The `sftp` command secure file transfer program using an interactive SSH-based FTP interface. Networking commands handle connectivity testing, DNS resolution, data transfer, remote access, firewall rules, and traffic analysis.
Linux is the dominant server operating system, and strong networking skills are essential for web hosting, container orchestration, security auditing, and infrastructure management. The command accepts 4 commonly used flags shown above, though the full set of options is available in the man page (`man sftp`).
The 3 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.
Related commands
More Network Commands
Other commands in the Network category