SSH-Key-Passphrase funktioniert in Windows, jedoch nicht in Linux
-
10-12-2019 - |
Frage
Ich arbeite an einem Projekt in Git. In Windows verwende ich GIT-Erweiterungen, um dieses Projekt zu verwalten, und auf den Zugriff auf das öffentliche Repository, das sie mir einen PPK-Schlüssel gegeben haben.Ich lade es in Git-Verlängerung, mit der Passphrase, die sie mir gegeben haben, und es funktioniert.
Jetzt habe ich eine virtuelle Linux (Ubuntu-32bit) eingestellt, und ich möchte auch von diesem Computer auf das Repository zugreifen.
aus einem anderen Thread, den ich in dieser Site gesehen habe, benutze ich, um das Repository zu klonen, den folgenden Befehl: generasacodicetagpre.
Dann sagt mir die Hülle, die Passphrase einzufügen generasacodicetagpre.
Aber wenn ich es einfüge, sagt es mir, dass das eine schlechte Passphrase ist.Ich habe es sehr mal überprüft, und ich bin sicher, dass ich dieselbe Passphrase verwende, die ich in Windows verwende.Wie kann ich also den Schlüssel in Linux richtig verwenden?
Vielen Dank im Voraus für Ihre Antworten.
Lösung
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.