Error: Config profile could not be found
Overview
When using the SFTP Gateway CLI you may encounter this error message:
The config profile (sftpgw-api) could not be found
To reproduce the error, run the any command involving sftpgw.sh
such as this:
sftpgw.sh get-users
Resolving the Error Message
To resolve this issue, you will need to configure the named profile sftpgw-api
.
Although named profiles are used by the AWS CLI, you will also need one for the sftpgw.sh CLI.
Note: The sftpgw-api
named profile doesn't give you permissions to any resource. But it does need to exist in order for the sftpgw.sh
CLI to work.
Run the following commands:
sudo su
cat /opt/sftpgw/application.properties
You should see the following:
cli.aws_access_key_id=ABCDEFG
cli.aws_secret_access_key=HIJKLMNOP
Your values may vary. Next, run the following commands:
sudo aws configure set aws_access_key_id ABCDEFG --profile sftpgw-api
sudo aws configure set aws_secret_access_key HIJKLMNOP --profile sftpgw-api
sudo aws configure set profile.sftpgw-api.region us-east-1
sudo aws configure set profile.sftpgw-api.output json
Remember to change the values for the:
- key
- secret
- region
The AWS key and secret are random and auto-generated. These values don't need to be valid, but they do need to exist.
Then, to test the functionality of the CLI, run the command:
sftpgw.sh get-users
You should see an array of SFTP users, rather than the error message you saw earlier.