0

I have a problem when trying to use SSH through the terminal. I know that in Windows, you have to use PuTTY to ease this kind of connections, and it works fine when using it to connect remote servers that has the public key version of my key.ppk file.

The problem is that when using PowerShell/Git Bash I can't manage to download anything through SSH. It loads forever in this screen:

Demostration of infinite loading screen

I have my key.ppk loaded in Pageant Key list:

Pageant Key List

Now, this hasn't been an issue until now because I mostly handle my SSH connections through PuTTY sessions and also through a Git client (I use GitKraken), that -according to my knowledge- makes use of Plink.

But now, in a work project I need to provide my SSH private key into a directory so the Docker build can get it and access the company repositories (my public key is already loaded into my BitBucket account). Of course, this isn't working.

So I have two questions:

  • How to make my SSH key be available to be used in terminal
  • Also, I'd like to know how to get the OpenSSH version of my key in order to stored as an id_rsa extensionless file in the mentioned repo directory for the Docker build

I know that using PuTTY you can manage to do the latter (Menu Conversion > Export OpenSSH key), but I still don't know if saving it without an extension is enough.

Btw: I've searched a lot and there is a lot of questions about this but none have been helpful.

Thanks in advance.

Kenny Horna
  • 51
  • 1
  • 6
  • by cmd/Bash I assume it's WSL? – mforsetti May 11 '20 at 02:43
  • Looks like Git Bash to me. // I’m not sure whether Pageant speaks the OpenSSH agent protocol. – Daniel B May 11 '20 at 11:22
  • Yes, I was referring to Git Bash (same result with PowerShell though) – Kenny Horna May 11 '20 at 11:27
  • @KennyHorna _Just an FYI: PuTTY is one means of doing this, [GPG4Win](https://www.gpg4win.org/) [Kleopatra] and [Win32-OpenSSH](https://github.com/PowerShell/Win32-OpenSSH/wiki) are two other ways to keep a key loaded in the way that `pageant` does._ First screenshot: Why are you not saving the key to the registry, as unless you do so once, you're always going to get that output, as host keys, when choosing `Y`, are saved to `HKCU\Software\SimonTatham\PuTTY\SshHostKeys`. You may want to consider using a single GPG subkey for SSH, which can then be converted to an OpenSSH or PuTTY SSH key. – JW0914 May 12 '20 at 14:34
  • @KennyHorna _Cont'd..._ For converting a PuTTY key to an OpenSSH private/public key pair, see [this](https://superuser.com/questions/232362/how-to-convert-ppk-key-to-openssh-key-under-linux) answer. – JW0914 May 12 '20 at 14:40

1 Answers1

0

The id_rsa extensionless file should be enough. Here's some things you could try:

  • If git bash has the file utility, you can run it on the ssh key (file id_rsa) to verify that it is the right type of file.
  • Move the key to a folder named ".ssh" in your Windows user directory. I don't remember if git bash has its own separate user directory. If it does, you should use that one.

If none of those work, you might want to try OpenSSH's own ssh-agent:

# start the ssh-agent in the background
$ eval $(ssh-agent -s)
> Agent pid 59566
$ ssh-add ~/.ssh/id_rsa # (or whatever path you have the ssh key in)

source

bep
  • 3
  • 4