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>

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

26,412 views 26 12
Join discussion

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