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

1 vote
Accepted answer

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

Thanks a lot :)

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,

 

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

Thanks a lot Bruno for the prompt reply.

 

Thanks,

Bubai

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 ...

695 views 5 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