sftp

interactive file transfer program

Supplementary instructions

sftp command is an interactive file transfer program. The operation and use of the command are similar to the ftp command. However, the sftp command uses ssh encryption for all transmitted information. It also supports public key authentication and compression functions. .

grammar

sftp(options)(parameters)

Options

-B: Specify the buffer size when transferring files;
-l: Use ssh protocol version 1;
-b: Specify batch file;
-C: Use compression;
-o: Specify ssh options;
-F: Specify ssh configuration file;
-R: Specify how many requests can be tolerated at one time;
-v: Increase the log level.

Parameters

Target host: Specify the sftp server IP address or host name.

Example

Establish a connection

$ sftp username@1.1.1.1 # Enter the password

Get the file downloaded to the specified path

sftp> get /export/sftp/test.csv /Users/my/Downloads
Fetching /export/sftp/test.csv to /Users/my/Downloads/test.csv
/export/sftp/test.csv 100% 133 0.3KB/s 00:00

Upload local files to the specified path on the server

sftp> put /Users/my/Downloads/re-produce.gif /export/sftp
Uploading /Users/my/Downloads/re-produce.gif to /export/sftp/re-produce.gif
/Users/my/Downloads/re-produce.gif 100% 257KB 86.6KB/s 00:02