Show Contents / Index / Search

Run sftp Batch Files

Using sftp batch files provides a secure way to automate file management.

To create and run an sftp batch file

  1. Configure the client and server to support a non-interactive client authentication method, such as GSSAPI, or public key without passphrase protection.

    Note: Authentication methods that require interaction are not supported when you use the sftp batch file option (-B).

  2. On the client, create an sftp batch file. For example, you might create a file called demo with commands such as:

    get demo/file1

    get webfiles/*.htm

  3. Use sftp to connect to the remote host and run the batch file. For example:

    sftp -B demo myname@myhost.com

The client runs the commands in the batch file and then exits.

Related Topics

Supported sftp Commands

Configure Public Key User Authentication

Configure Kerberos Server and Client Authentication

Secure File Transfer (sftp)