Run sftp Batch Files
Using sftp batch files provides a secure way to automate file management.
To create and run an sftp batch file
- 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).
- On the client, create an sftp batch file. For example, you might create a file called demo with commands such as:
- Use sftp to connect to the remote host and run the batch file. For example:
sftp -B demo firstname.lastname@example.org
The client runs the commands in the batch file and then exits.