sftp is an interactive file transfer program, similar to ftp(1), which
performs all operations over an encrypted ssh(1) transport. It may also
use many features of ssh, such as public key authentication and
compression. sftp connects and logs into the specified host, then enters
an interactive command mode.
The second usage format will retrieve files automatically if a non-
interactive authentication method is used; otherwise it will do so after
successful interactive authentication.
The third usage format allows sftp to start in a remote directory.
The final usage format allows for automated sessions using the -b option.
In such cases, it is necessary to configure non-interactive
authentication to obviate the need to enter a password at connection time
(see sshd(8) and ssh-keygen(1) for details). The options are as follows:
-1 Specify the use of protocol version 1.
-2 Specify the use of protocol…