SFTP Gateway 2.0 Command Line Interface Overview
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 a custom container location
If you wanted to upload the user’s files to a container named my-bucket-name
with a path of 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