Git returns "Insufficient permissions" even after an SSH key has been added

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

Problem

When pushing to a repository, the following is returned on the command line, even though SSH keys have been added to the repository or the user's profile, with write access:

fatal: remote error: Insufficient permissions 
You cannot push to <branch-name>. Pushing requires write access and your access is read-only. 
fatal: Could not read from remote repository.

Diagnosis

Diagnostic Steps

  • Ensure an SSH key has been added for the user or the repository, with write access
  • Attempt to push a change to the repository

Cause

The user likely has another SSH key somewhere on the filesystem, that is different from the one added to Bitbucket Server.

Resolution

  • Check the ~/.ssh/config file for a path to another SSH public key
  • Add this key in place of the one currently added to the repository or the profile
Last modified on Jul 1, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.