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.
Copy
Ask AI
Pushing to git@beta.aptible.com:[environment]/[app].gitPermission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.
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.
Copy
Ask AI
ssh -T git@beta.aptible.com test
On successful authentication, you’ll see this message:
Copy
Ask AI
Hi [email]! Welcome to Aptible. Please use `git push` to connect.
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):
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.
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.