
Termination on error can be suppressed on a command by command basis by prefixing the command with a " -" character (for example, -rm /tmp/file*). sftp will abort if any of the following commands fail: get, put, rename, ln, rm, mkdir, chdir, ls, lchdir, chmod, chown, chgrp, lpwd, df, symlink, and lmkdir. If batchfile is specified as a dash (" -"), standard input will be read for the batch of commands. Since it lacks user interaction it should be used in conjunction with non-interactive authentication. The default is 32768 bytes.īatch mode reads a series of commands from an input batchfile instead of stdin. Larger buffers require fewer round trips, but require more memory to do so. Specify the size of the buffer that sftp uses when transferring files. If you're not sure that you need it, do not specify this option. This option provides compatibility with very old servers. Specify the use of protocol version 2, which dates back to 1997. Specify the use of protocol version 1, which dates back to 1997. Here is a description of each of the options listed in the command syntaxes listed above. Sftp -b batchfile [ host For examples of using batch mode, and a guide to setting up public key authentication, see Batch Mode. To use batch mode, it is necessary to configure non-interactive authentication, such as public key authentication, so that you don't have to manually enter a password.

(For more information about each option and it's possible values, see the Options section, below).

There are four basic ways to use sftp, and the command syntax for each is listed here. It uses many of the features of ssh, such as public key authentication and data compression. Sftp performs all operations over an encrypted ssh session.

So, for anonymous FTP transfers, use regular ftp. Because all sftp connections are encrypted, they require a username and password (or public key authentication). If you need to transfer files over anonymous FTP, sftp is not the program to use.
