brackets-userland / brackets-git

brackets-git — git extension for adobe/brackets
Other
656 stars 192 forks source link

Support using SSH keys with passphrase, readme update needed #1128

Open Pysis868 opened 9 years ago

Pysis868 commented 9 years ago

SSH key passphrases are always better to use:

Readme says:

  • Windows (Go to point 3 if you have already a rsa key already generated)
    • Create a ssh pair key with PuttyGen RSA with 2048 bytes. Don't add any password. Save the PPK and upload the public key to the git server.

This should be changed, and instructions added to use a secure approach.

I have added my key to Pageant from the PuTTy distribution, and to the GitHub server. The error I see in Brackets show this code for about 30 seconds to a minute:

Brackets Git encountered an error...
Pushing to remote failed
Error: cmd-spawn-timeout: git push --porcelain --progress origin master

When executing ssh -T -vvv git@github.com in the terminal:

debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /.../.ssh/known_hosts:1
debug2: bits set: 1024/2048
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /.../.ssh/identity (0x0)
debug2: key: /.../.ssh/id_rsa (0xa01a438)
debug2: key: /.../.ssh/id_dsa (0x0)
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /.../.ssh/identity
debug3: no such identity: /.../.ssh/identity
debug1: Offering public key: /.../.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug2: input_userauth_pk_ok: fp 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

debug3: sign_and_send_pubkey
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/.../.ssh/id_rsa':

GitHub for Windows worked before ever messing with Pageant, but it may use a different key, and I'm not exactly sure what to investigate here.

Pysis868 commented 9 years ago

Btw, in case someone comes across this issue, I have eliminated the password requirement using plink and pageant, which seems to integrate nicely into my existing setup. I have documented the details in what seemed to be a helpful thread for setting up repository communication, as referenced by the readme:


Since then I have found this information as "tips" (it was hiding :) ):

Working with SSH repositories: SSH protocol is currently a bit more difficult, so you'll have to use command line or try to follow these tips: