Forums

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

Alternative way for getting recovery codes for two-step verification?

Erwin de Jong February 4, 2019

To start with, I'm not exactly an expert in these matters, and also, I kinda doubt there is an answer to this, but here goes anyway.

I had some rather serious issues with my phone, had to do resetting and reinstalling and stuff, and now it's no longer seen as the same device. As such, Authy will no longer give me a code for Two-Step verification. The next step then is to use a recovery code, but if I have them I don't know where. I read about getting them through SSH, and my laptop should be the system with the key, but I get the following result:

Warning: Permanently added the RSA host key for IP address '18.205.93.2' to the list of known hosts.
Load key "C:\\Users\\Erwin de Jong/.ssh/id_rsa.ppk": invalid format
git@bitbucket.org: Permission denied (publickey).

So that doesn't work. An alternative solution is to simply make a new account, but I kinda need to use the same e-mail address.

And with that, I'm a bit at a loss, and don't see a next step. Wouldn't be surprised if there isn't one, but maybe someone has a tip for me still?

1 answer

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 5, 2019

Hi Erwin,

What command were you using when you got that error message? Was it:

ssh git@bitbucket.org recovery_codes

 If that doesn't work, can you run the following command and see if your SSH key is listed?:

ssh-add -l

Let us know how it goes!

Ana

Erwin de Jong February 5, 2019

Hi Ana,

That was indeed the command I used, so I skipped right to next command you gave me.
However, that one gives me the following result:

Error connecting to agent: No such file or directory

I'm working on a Windows machine means I can't use that command?

My setup for all this is a few years old, and I had help at the time getting everything running, so I don't know really well how all this works together. but doesn't the fact that I can use SourceTree to push and pull mean that I do have a working SSH key?

Erwin de Jong February 15, 2019

Hi Ana,

Is there something else I can do? It has been suggested to me that I simply make a new account, but getting notifications on the e-mail associated with my current account is by far the most practical.

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 15, 2019

Hi Erwin,

The command I gave you will work in Windows too, but seems like the SSH agent is not running on your machine. Which SSH agent are you using? Can you start it? 

Which Windows version are you using? I found this thread where other users were facing a similar issues following a Windows update. I'm not saying this is exactly the problem you're facing, just that we shouldn't despair yet :) 

When you use Sourcetree, are you also using SSH?

Let us know!

Ana

Erwin de Jong February 15, 2019

Hi Ana,

That thread did help me, but I'm not there yet. I'm going to copy a bit from the comment in that thread by user johncrim, for reference:

Check status in powershell:


get-service ssh*

If the service is disabled, start it and set to manual:


Set-Service -Name ssh-agent -StartupType Manual
Start-Service ssh-agent

As it turns out, I did not have an ssh-agent running. I turned it on this way, and it's OpenSSH Authentication Agent.

I'm not sure where to check exactly, but I'm assuming this means I do not use SSH when I use Sourcetree.

Anyway, ssh-add -l works now, but nothing is listed. It says "The agent has no identities".

I'm guessing I'll have to use ssh-add to add one now, and I need to look into this command a bit further. I do not want to end up breaking anything though, and I know very little about this.

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 15, 2019

Ok, that's good! We're improving :) 

As you said, now you need to add your SSH key to the agent. This is explained in our documentation and you can find it here. My understanding is that you already have the public part of the key saved to Bitbucket, so you'll only need to follow the step #2.

This won't have an effect on your repository so you shouldn't be worried about that, you will not break it. 

Let us know how it goes, Erwin!

Cheers,

Ana

Erwin de Jong February 20, 2019

Hi Ana,

This does not work, unfortunately, and I think it's really the same problem as the one I ran into originally. I get the following response:

PS C:\WINDOWS\system32> ssh-add "c:\Users\Erwin de Jong\.ssh\id_rsa.ppk"
Error loading key "c:\Users\Erwin de Jong\.ssh\id_rsa.ppk": invalid format

That's what I was told before, the format is invalid. But I do believe these are keys that I have in use already.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events