Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Cannot add SSH key to Stash

Svante Gustafsson Björkegren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 14, 2014
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

1 vote
Answer accepted
Svante Gustafsson Björkegren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 14, 2014

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

Mira Hedl July 12, 2015

What is *name* of the table?

Patrick Viet January 22, 2016

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>

0 votes
Bruno Lavit July 7, 2015

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

Svante Gustafsson Björkegren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2015

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

Bruno Lavit July 12, 2015

Thanks a lot :)

Patrick Viet January 22, 2016

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 January 3, 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.

Bruno Lavit January 3, 2018

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 January 3, 2018

Thanks a lot Bruno for the prompt reply.

 

Thanks,

Bubai

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events