Skip to content

Instantly share code, notes, and snippets.

@jakobvase
Last active October 2, 2024 07:13
Show Gist options
  • Save jakobvase/e7e6a8401861531405a5f146d82edac3 to your computer and use it in GitHub Desktop.
Save jakobvase/e7e6a8401861531405a5f146d82edac3 to your computer and use it in GitHub Desktop.
Creating an AWS sftp server for testing

Creating an AWS sftp server for testing

I created an sftp server in aws for testing.

  • Generate an ssh key pair ssh-keygen -t ed25519
  • Log in to AWS
  • Go to s3 and create a bucket for the server
  • Go to IAM and create a role
    • Pick 'AWS Service'
    • Select 'Transfer' as the use case
    • Add the following permissions:
      • AmazonS3FullAccess
  • Go to AWS Transfer Family
  • Create a server and click 'next' on everything
  • Go to the server and add a user
    • set the role you created on the user
    • set the s3 bucket you created as his home directory
    • set the 'optional folder' to /
    • add the public ssh key you created to the user
  • Now it's setup. Be aware that connecting and using rooted paths will start at the s3-level, so list("/") will list all buckets in your s3.
  • Test it works sftp -i path-to-ssh-private-key username@transfer-family-server-url <<<ls

Remember to delete the server, role, and bucket again when you're done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment