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

SSH KEY INVALID

Cornelius October 25, 2023

Hi, all. I am new to bitbucket, and I am trying to connect UiPath (An automation tool) to bitbucket. I generated a ssh key on my pc using ssh-keygen and it got saved. When I open the key in notepad and paste in Add SSH key under Personal settings, it says the SSH key is invalid. Please advise if I am doing something wrong?

 

Best Regards

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 26, 2023

Hello @Cornelius and welcome to the Community!

It might have been the case that the command you used to generate the key used an encryption algorithm that is not supported by Bitbucket Cloud.

I would suggest trying to recreate the key following the instructions outlined in the following documentation, according to your platform : 

It's important to note that the key you need to add to Bitbucket is the public key (the extension of the file will be.pub)

Hope that helps! Let us know in case you have any questions or run into any issues following the instructions in the above articles.

Thank you, @Cornelius !

Patrik S

Cornelius November 9, 2023

Hi Patrik, thank you for your response. I've installed GIT and when running through GIT Bash, I am not able to start the SSH service. Do you have any advice re that?

bitbucket.PNG

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 13, 2023

Hi Cornelius,

Based on the output, it looks like there may be other ssh-agent processes running on this computer.

You can run the following command to double-check if there is another ssh-agent process running:

ps -a | grep ssh-agent

If there is, you don't need to start the ssh-agent again.

Kind regards,
Theodora

Cornelius November 14, 2023

SSH.PNG


Hi Theodora, thank you for your prompt reply. I ran this and it took me to the next line, so I am not sure if the agent is running ?Then after I tried to start the agent as described on Set up SSH key for Windows. I get the following error. Would you please be able to advise?

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 16, 2023

Hello @Cornelius ,

It seems like there's some issue with the installation of SSH. I would suggest uninstalling git for windows from your machine, and trying downloading and installing it again from https://git-scm.com/download/win .

Once the new installation is completed, you can try starting the SSH agent again. If the issue persists, could you try the same in a different machine and let us know if you get the same error?

Cornelius November 20, 2023

Hi Patrik, I tried reinstalling, and it had the same issue. However, on a different machine I was able to, do you know of why it is not generating one on the desired machine?

I'll appreciate any advice.

 

Best Regards

 

Corenelius

SNIP.PNG

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 21, 2023

Hello @Cornelius ,

As this is particular to one machine only, it seems to be an issue with either the OS or the installation of SSH.

I would suggest trying the following command to compare the SSH version in each of the machines and check if the version are different :

ssh -V

Also, the ssh-agent is a tool used to facilitate the authentication when your ssh key contains a password, so you don't have to type the password every time. However, the ssh-agent is not required to connect to Bitbucket.

In this case, as an alternative to the ssh-agent, you could try creating  a file called config in the directory ~/.ssh/ with the following content :


 Host bitbucket.org
     HostName bitbucket.org
     User git
     IdentityFile ~/.ssh/<name of your private key>
     IdentitiesOnly yes

where in IdentityFile line you should provide the path to the private key, of which the corresponding public key you have already added to your Bitbucket account.

This config file will instruct SSH to use that key for any SSH connection to bitbucket.org domain. You can then use the command below to test cloning a repository you have access to : 

GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_SSH_COMMAND="ssh -vvv" git clone git@bitbucket.org:<workspace>/<repository>.git

Thank you, @Cornelius !
Patrik S

Cornelius November 22, 2023

Hi Patrik, the versions were same. I managed to generate an SSH key through installing source tree and added it under Personal Key in Bitbucket. After I tried to push it to the repo by cloning the ssh url after git clone but I am getting an error saying failing to connect to bitbucket.org :(bit.PNG

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 23, 2023

Hello @Cornelius ,

From the screenshot you have shared, it seems you are using a different tool to interact with Bitbucket, which seems to be UIPath. Unfortunately, I have limited knowledge of the UIPath configuration.

Did you have a chance to test creating the config file, and using the clone command with verbose logs I shared in my previous comment? That command needs to be executed inside the git bash terminal.

Thank you, @Cornelius !

Patrik S

Like Sabine Mayer likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events