SFTP Gateway 2.0 Command Line Interface Overview
Note: This page applies to SFTP Gateway version 2.x. Visit Here for documentation on version 3.x.
Create a user
sftpgw.sh create-user --username robtest
This creates user with the defaults. But there’s no SSH key, so you won’t be able to log in with SFTP.
Create a user with an SSH public key
sftpgw.sh create-user --username robtest --pub-ssh "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9Rd6J+j2GR5/ox4+3xykJOAb7jUtaTQuAHfi5uz7gcfBguIJUcyOZrKm2ueaT8dfMaq10k/PpJWG3uPoKSgbIYG1PZ+yvfyj8pctPNcgerHxNq74iGWYlhgbIIoammNaNHUkAZHRVIHwtEqE7+BgE5Q+aerTRL6vrk2HJhvkPMDN4VclYzmsNfIMPkBL7T+KiL3H8grlR7i/x4Rd5+rccTLNPt+mj79YwMxo5TofcwUS+zMgHTI5zXBcIZKVj+TfXEyDxmPwiUn5PBCDU/epnDUd/5biUcO+27YUWGBBpxfGwCpBfTFDkpdng6ep7htOoTEw/Ta0uWtbPEJiJKnqv"
You should then be able to connect using your private key.
sftp -i private.key robtest@<ip address>
Create user with encryption option
By default, users are created with the SSE-S3 option enabled.
You can set this explicitly:
sftpgw.sh create-user --username robtest --s3-encryption-level 1
Create user with a custom S3 bucket location
If you wanted to upload the user’s files to s3://my-bucket-name/inbox
, you can do this:
sftpgw.sh create-user --username robtest --bucket-name my-bucket-name --path inbox
Create user with shared and download directories
sftpgw.sh create-user --username robtest --download-dir TRUE --shared-dir TRUE