git Push Permission Denied
When pushing to your App’s Git Remote, you may encounter a Permission denied error. Below are a few common reasons this may occur and steps to resolve them.
Wrong SSH Key
If you attempt to authenticate with a public SSH key not registered with Aptible, Git Authentication will fail and raise this error.
To confirm whether Aptible’s Git server correctly authenticates you, use the ssh command below.
On successful authentication, you’ll see this message:
On failure, you’ll see this message instead:
Resolution
The two most common causes for this error are that you haven’t registered your SSH Public Key with Aptible or are using the wrong key to authenticate.
From the SSH Keys page in your account settings (locate and click the Settings option on the bottom left of your Aptible Dashboard , then click the SSH Keys option), double-check you’ve registered an SSH key that matches the one you’re trying to use. If you’re still running into issues and have multiple public keys on your device, you may need to specify which key you want to use when connecting to Aptible. To do so, add the following to your local ~/.ssh/config file (you might need to create it):
Environment Permissions
If you don’t have the proper permissions for the Environment or because the Environment/App you’re pushing to doesn’t exist, you’ll also see the Permission denied (publickey) error above.
Resolution
In the Dashboard, check that you have the proper permissions for the Environment you’re pushing to and that the Git Remote you’re using matches the App’s Git Remote.
Was this page helpful?