Domanda

Sto lavorando a un progetto in Git. In Windows, sto usando le estensioni Git per gestire questo progetto e per accedere al repository pubblico che mi hanno dato una chiave .ppk.Lo carico in estensione git, con la passphrase che mi hanno dato, e funziona.

Ora ho impostato una macchina virtuale Linux (Ubuntu-32bit) e voglio accedere anche da questa macchina al repository.

Da un altro thread che ho visto in questo sito, uso, per clonare il repository, il seguente comando:

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

Allora, la shell mi dice di inserire la passphrase

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

Ma quando lo inserisco, mi dice che è una brutta passphrase.L'ho controllato un sacco di volte, e sono sicuro che uso la stessa passphrase che uso in Windows.Quindi, come posso usare correttamente la chiave in Linux?

Grazie in anticipo per le tue risposte.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top