fatal: remote error: Insufficient permissions

I have a Stash user authenticating via AD who has write access to a project and is unable to push to a specific repository. He's able to push to repositories in other projects. SSH is setup correctly; cloning is fine, but pushing results in fatal: remote error: Insufficient permissions

You do not have permission to push to the repository retailpaymentservices in

project Fully Governed Enterprise Services

fatal: Could not read from remote repository.

3 answers

1 accepted

1 vote
Accepted answer

Has the SSH key been added to the user's account (User Profile > SSH keys)? You can do a quick check by having the user do:

ssh -p <ssh-port> <ssh server> whoami

for instance

ssh -p 7999 stash.server.comwhoami

Thanks Michael, it has. difference being that we redirect 22 => 7999 via BigiP.

Ok, that eliminates one potential issue.

I've just checked the code paths and that error message is written when

  • the user is authenticated
  • and the user has read access to the repository
  • but the user does not have write access

So, I'd double check the permissions on the project in question and the user's group memberships to make sure it's all set up correctly.

From earlier answers it sounds like you've already double-checked this. Assuming everything is set up correctly and it's still not working, it might be a bug. Perhaps https://jira.atlassian.com/browse/CWD-3796?Do you have multiple User directories set up for Stash?

Just one AD directory. I've given this user write access via group and as an individual user, with no success. Thanks again for your suggestions.

Wow...I am chagrined. Please accept my apologies for wasting the community's time on this and set my karma points to -50. Turns out my remote developer was using someone elses SSH keys. (not kidding).

I expected it to be something trivial but this is still quite surprising. :D

This project and its repositories are working fine for other users with write access. Thanks.

Two ideas:

- Are the write permissions given to a group that the user should belong to, but actually does not? (You can check the group memberships if you open the user's details in Administration/Users on the web interface.)

- It is possible that some branch permissions setting prevents the user from pushing to the branch they were trying to push to. (Repo's page -> Settings/Branch permissions)

Balazs, thanks for your response. user does have group membership and there are no explicit repository, branch permissions or hooks that would prevent this push. probably something simple, but unable to solve it so far.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

425 views 6 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you