AWS Transfer for SFTP
User Guide

Transfer Files Using AWS SFTP

You transfer files over the AWS SFTP service by specifying the transfer operation in an SFTP client. AWS SFTP supports the following SFTP clients:

  • OpenSSH (Macintosh and Linux)

  • WinSCP (Microsoft Windows only)

  • Cyberduck (Windows, Macintosh, and Linux)

  • FileZilla (Windows, Macintosh, and Linux)

Following, you can find how to transfer files with each client.

Using OpenSSH

Use the instructions that follow to transfer files from the command line using OpenSSH.

To transfer files over AWS SFTP using the OpenSSH command line utility

  1. On Linux or Macintosh, open a command terminal.

  2. At the prompt enter the following command: % sftp -i transfer-key sftp_user@service_endpoint,

    In the preceding command, sftp_user is the user name and transfer-key is the SSH private key. Here, service_endpoint is the SFTP server's endpoint as shown in the AWS SFTP console for the selected SFTP server.

    An sftp prompt should appear.

  3. At the sftp prompt, enter the following command: sftp> pwd

  4. On the next line, enter the following text: /mybucket/home/sftp_user

    In this getting-started exercise, this Amazon S3 bucket is the target of the file transfer.

  5. On the next line, enter the following command: sftp> put filename.txt

    The put command transfers the file into the Amazon S3 bucket.

    A message like the following appears, indicating that the file transfer is in progress, or complete.

    Uploading filename.txt to /my-bucket/home/sftp_user/filename.txt

    some-file.txt 100% 127 0.1KB/s 00:00

Note

It can take a few minutes after your server is created for the DNS service in your environment to be able to resolve your server endpoint hostname. For testing purposes, use a regional endpoint and log in as user_name.serverid@service_endpoint.

For a list of AWS Region endpoints for AWS SFTP, see AWS Transfer for SFTP in AWS Regions and Endpoints in the AWS General Reference.

Using WinSCP

Use the instructions that follow to transfer files from the command line using WinSCP.

To transfer files over AWS SFTP using WinSCP

  1. Open the WinSCP client and choose New Session.

  2. For File protocol, make sure that SFTP is chosen in the Login dialog box.

  3. Choose New Site from the folder list at left, as shown following.

  4. For Host name, enter your server endpoint.

  5. For Username, enter the name for the user that you created in Add a User.

  6. Choose Advanced to open the Advanced dialog box, shown following, and then in the left pane choose Authentication in the SSH section.

  7. Browse for and choose the SSH private key file from your file system.

  8. If WinSCP offers to convert your SSH private key to the PPK format as shown following, choose OK.

  9. Choose OK to return to the Login dialog box, and then choose Save.

  10. In the Save session as site dialog box shown following, choose OK to complete your connection setup.

  11. Open the Preferences page, choose Endurance under the Transfer tab and then choose Disable for the Enable transfer resume/transfer to temporary filename for option. If you leave this option enabled, it will increase upload costs, substantially decrease upload performance, and will lead to failures of large file uploads.

  12. Choose Background under Transfer tab and make sure the Use multiple connections for single transfer option is unchecked. If you leave it selected, it will cause large file uploads to fail in unpredictable ways, including creating orphaned multi-part uploads which incur S3 charges. Silent data corruption can also occur.

  13. Perform your SFTP file transfer.

    You can use drag and drop methods to copy files between the target and source windows. You can use toolbar icons to upload/download, delete, edit, or modify the properties of files in WinSCP.

Note

Because Amazon S3 manages object timestamps, make sure to disable WinSCP timestamp settings before you perform AWS SFTP file transfers. To do so, in the WinSCP Transfer settings dialog box disable the Set permissions upload option and the Preserve timestamp common option.

Using Cyberduck

Use the instructions that follow to transfer files from the command line using Cyberduck.

To transfer files over AWS SFTP using Cyberduck

  1. Launch Cyberduck and choose Open Connection to open the Connection dialog box.

  2. For Protocol, choose SFTP (SSH File Transfer Protocol).

  3. On the AWS SFTP Servers page, choose the check box by the name of the SFTP server that you want to use.

  4. For Server, enter the service endpoint, as shown following.

  5. For Username, enter the name for the user that you created in Add a User.

  6. For SSH Private Key, choose the SSH private key.

  7. (Optional) For Path, choose More Options, and then enter a target or source Amazon S3 directory.

  8. Choose Connect.

    The Amazon S3 directory opens in one of the panes of the SFTP client.

  9. Depending on where your files are, do one of the following:

    • In your local directory (the source), choose the files that you want to transfer, and drag and drop them into the Amazon S3 directory (the target).

    • In the Amazon S3 directory (the source), choose the files that you want to transfer, and drag and drop them into your local directory (the target).

Cyberduck transfers the files.

Using FileZilla

Use the instructions that follow to transfer files from the command line using FileZilla.

To set up FileZilla for an SFTP file transfer

  1. Choose Connect to open the Connection dialog box.

  2. In the list at the top, choose SFTP as the protocol.

  3. For Port, enter 22.

  4. For Server, enter the hostname.service_endpoint for the SFTP server as listed in the AWS SFTP console for the selected server.

  5. For Username, enter the name for the user that you created in Add a User. Use the format username.serverId. The serverId is listed in the AWS SFTP console.

  6. Choose Browse and upload the SSH private key into this FileZilla connection.

  7. Choose Connect.

Note

If you interrupt a file transfer in progress, AWS SFTP might write a partial object in your S3 bucket. If you interrupt an upload, check that the file size in the S3 bucket matches the file size of the source object before continuing.