Network

sftp

Secure file transfer program using an interactive SSH-based FTP interface.

Synopsis

syntax
sftp [OPTION]... [USER@]HOST[:PATH]

Examples

Start interactive SFTP session
sftp user@host
Connect on non-standard port
sftp -P 2222 user@host
Run batch commands
sftp -b commands.txt user@host

Common options

FlagDescription
-PPort number
-iIdentity file
-bBatch file with commands
-rRecursively 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

Related tools