J
J
Jekson2019-06-26 10:51:05
SSH
Jekson, 2019-06-26 10:51:05

Accessing a repository on bitbucket via ssh?

I set up access to the turnip on bitbucket from the local machine via ssh, everything is fine. Now I want to deploy to a production server. I created a new key on the server, added a new key to bitbucket, copied key.pub there. I do git clone [email protected]:st_c/name.git and get

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

Can you tell me how to set up access?
How does the system understand where to look for the key and select the right one if there are a lot of them?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
L
Lynn "Coffee Man", 2019-06-26
@Lynn

https://superuser.com/a/232406/103089
Create file ~/.ssh/config

host bitbucket.org
 IdentityFile ~/.ssh/cv-key

Or don't bother and rename the key to id_rsa , then ssh will find it.

P
Pychev Anatoly, 2021-10-17
@pton

For those who get here and the higher solutions will not work.
RSA Algorithm Becomes Deprecated Bitbucket
's recommendation to use a different algorithm or stub (requirement to use rsa). As a result, in my config

Host bitbucket.org
  HostName bitbucket.org
  Port 22
  HostKeyAlgorithms=+ssh-rsa
  PubkeyAcceptedKeyTypes +ssh-rsa
  IdentityFile ~/.ssh/id_rsa

K
klepiku, 2019-06-26
@klepiku

https://habr.com/ru/post/266667/

J
Jekson, 2019-06-26
@Lepilov

Solved the problem by adding on the server

eval `ssh-agent`
ssh-add ~/.ssh/<private_key_file>

https://confluence.atlassian.com/bitbucket/set-up-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question