
Warum, oh warum, werde ich beim Klonen von GitHub nach einer Passphrase gefragt??
git clone [email protected]:test/testchef.git
Cloning into 'chef'...
The authenticity of host 'github.com (xxx.xxx.xxx.xxx)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,xxx.xxx.xxx.xxx' (RSA) to the list of known hosts.
Enter passphrase for key '/root/.ssh/git_id_rsa.pub':
hier ist meine SSH-Konfigurationsdatei:
Host *github.com
IdentityFile ~/.ssh/git_id_rsa.pub
wenn ich es von Fabric aus ausführe, erhalte ich keine Fehlermeldung, aber ich werde zur Eingabe der Passphase aufgefordert, wenn ich versuche, def bootstrap() zu klonen: put('ssh_config','/root/.ssh/config') put('git_id_rsa.pub','/root/.ssh/git_id_rsa.pub') put('git_id_rsa','/root/.ssh/git_id_rsa') run("""chmod 600 /root/.ssh/git_id_rsa*""") run("""eval ssh-agent -s
;ssh-add /root/.ssh/git_id_rsa""")
relevante Ausgabe von Fabric:
[107.170.196.221] out: Agent pid 2285
[107.170.196.221] out: Identity added: /root/.ssh/git_id_rsa (/root/.ssh/git_id_rsa)
[107.170.196.221] out:
Ich melde mich beim Server an und führe Folgendes von der Befehlszeile aus: eval ssh-agent -s
;ssh-add /root/.ssh/git_id_rsa git clone[email geschützt]:test/testchef.git
..super..ich kann klonen, ohne nach einer Passphase zu fragen. Warum hat es bei Fabric nicht funktioniert?
Antwort1
Denn die Identitätsdatei ist der private Schlüssel und nicht der öffentliche Schlüssel:
Host *github.com
IdentityFile ~/.ssh/git_id_rsa # Without the .pub