Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Using the same generated SSH connection for Bitbucket on multiple devices

GandolfJ July 14, 2019

Hi Community,

 

According to the instruction, I generated SSH keys on my work laptop. Added them in my Bitbucket.  Then I copied everything inside the .ssh folder to .ssh folder on my personal laptop. 

When I try to connect to the bitbucket on my personal laptop to fetch all changes after it prompts me to enter the (ssh) passphrase, after entering the phrase, it fails with the message:

remote: Invalid username or password

fatal: Authentication failed for '~my repo address~'

On the contrary, when I use 'git clone' command to clone the same repo and enter the same passphase it copies everything smoothly. 

 

I'm a novice to these things. Please help me to set up connections on both laptops.  

 

Thank you!

1 answer

1 accepted

1 vote
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 14, 2019

Hello @GandolfJ,

When I try to connect to the bitbucket on my personal laptop to fetch all changes

Hm, do you mean you're running git fetch command? I believe you're running this command in a local copy of a repository which is configured (e.g. was cloned) to use HTTP transport, not SSH. I believe this is the case because this error you're getting means you're not using SSH:

remote: Invalid username or password

You can verify my assumption by running the following command in your local copy:

git remote -v

If the URLs in the output have https scheme, then Git is not using SSH in this local repo copy. So you can two options:

  • get a fresh clone of that repo with SSH transport – make sure you select the right clone URL in the dialog
     bitbucket-rest-client — Bitbucket 2019-07-15 12-42-29.png
  • change remote URL of your current local copy of that repo to an SSH one:
    git remote set-url origin git@bitbucket.org:<workspace>/<repo_slug>

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

GandolfJ July 15, 2019

I managed to solve the problem and think I've had a few problems.  What did I do?

1. I cloned the repo as you suggested

2. I followed your instruction here https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html#SetupanSSHkey-Step1.Setupyourdefaultidentity

 (Originally I made mistake and added SSH keys for the specific repo not to an account in general)

3. I followed this instruction to troubleshoot issues when I was able to fetch from remote origin but was not able to push my changes

https://stackoverflow.com/questions/16074832/cannot-push-to-git-repository-on-bitbucket

 

thank you, Daniil!

Like Daniil Penkin likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events