Cannot add SSH key to Stash

Hi all,
Some time ago I added my public key to Stash (I created a project/repo and was able to pull/push stuff)
But I'm not longer able to push to Stash. And when I look at the ssh-keys settings in Stash it says:
No SSH keys have been added
But when I try to set my ssh key again I get this error message:
This SSH key is already used to access a repository or project
Any clues what is wrong? It looks like the account got duplicated or messed up. I have verified that there are no duplicate accounts.
Where is the actual key stored? In the database or in the home-directory?
Thnx in advance!
// Svante

2 answers

1 accepted

Problem solved!

I found the keys in the database and saw that the user had added his personal public key to both a project and a repo. This made it impossible to add the key to the personal profile.

After the key was removed from the Project and Repo it worked fine again :-)

Cheers,

// Svante

What is *name* of the table?

Hi,

Here is how to find the actual repositories once you got the user id from AO_FB71B4_SSH_PUBLIC_KEY :

select * from repository inner join sta_repo_permission on repo_id = repository.id where user_id=<the ID>

Hi Svante,

I have the same problem, but I'm not able to find the relevant Stash table which host the SSH keys.

Can you send me the table name please? smile

Thanks,

Bruno

Hey, The SSH keys are stored in the table: AO_FB71B4_SSH_PUBLIC_KEY (per Stash 3.4) The following query will give you any keys including the name "my-key": {code} select * from "AO_FB71B4_SSH_PUBLIC_KEY" key where key."KEY_TEXT" like '%my-key%' {code} Hope that helped! Cheers, // Svante

Hi,

Here is how to find the actual repositories once you got the user id from AO_FB71B4_SSH_PUBLIC_KEY :

select * from repository inner join sta_repo_permission on repo_id = repository.id where user_id=<the ID>

Bubai I'm New Here Jan 03, 2018

Hi,

 

I am running with the same problem you faced.

I am very new to GIT/BITBucket.

Can you please let me know where I am supposed to run the SQL query, you have mentioned in the above post? I have GIT Bash installed in my desktop. Do I need to install any other software to run the SQL query?

Thanks in advance for your help.

Hi Bubai,

You have to run the SQL query on the Bitbucket server.

Only your IT or release engineer can do that.

Cheers,

Bruno

Bubai I'm New Here Jan 03, 2018

Thanks a lot Bruno for the prompt reply.

 

Thanks,

Bubai

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

649 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot