ssh key passphrase works in windows but not in linux
Asked Answered
H

1

32

I'm working to a project in git. In Windows, I'm using git extensions to manage this project, and to access to the public repository they gave me a .ppk key. I load it into git extension, with the passphrase that they gave me, and it works.

Now I set a linux (ubuntu-32bit) virtual machine, and I want to access also from this machine to the repository.

From another thread that I've seen in this site, I use, to clone the repository, the following command:

ssh-agent bash -c 'ssh-add /home/myHome/mykey.ppk; git clone git@serveraddress:project.git'

Then, the shell tells me to insert the passphrase

Enter passphrase for /home/myHome/mykey.ppk:

But when I insert it, it tells me that's a bad passphrase. I've checked it a lot of times, and I'm sure that I use the same passphrase that I use in windows. So how can I use correctly the key in Linux?

Thanks in advance for your replies.

Hekking answered 9/3, 2012 at 8:55 Comment(2)
The command you are using to clone the repository looks somewhat strange. Is this a markup error in your question? If not, you should probably familiarize yourself with Linux command line first.Ecstatic
I've checked the command here in another thread, and it uses a private key without store it into the ssh configuration.Hekking
E
63

The Linux SSH client (typically OpenSSH) can't read the PPK format used by the Windows SSH client Putty. You need to convert the "PPK" key given to you into an OpenSSH key first. Install "putty" on Linux and use the puttygen command line tool:

$ sudo aptitude install putty
$ mkdir -p ~/.ssh
$ puttygen ~/mykey.ppk -o ~/.ssh/id_rsa -O private-openssh

Enter your passphrase, and you'll get an OpenSSH-compatible key in the standard location ~/.ssh/id_rsa. Afterwards you can just use ssh-add(without any arguments!) to add this key to the SSH agent.

Alternatively you can use the PUTTYgen program provided by putty on Windows.

Ecstatic answered 9/3, 2012 at 9:5 Comment(3)
Thank you. Good guide. I used the windows PUTTYGen. I loaded the key file and went to "Conversions > Export OpenSSH Key", then just saved it as <thename>.pemPfeiffer
I get puttygen: ./../sshrand.c:313: random_byte: Assertion `random_active' failed -- seems to be a known issue github.com/Homebrew/homebrew/issues/25734Duodenum
bigbadonk420: Run puttygen with sudo.Yaw

© 2022 - 2024 — McMap. All rights reserved.