سؤال

I'm new to Bazaar. I'm trying to setup my SSH Keys, but I'm always getting "Permission Denied".

Here are the things I did:

  1. Open PuTTYgen

  2. Click "Generate"

  3. Move around the mouse pointer

  4. Add a passphrase "password"

  5. Click the "Save public key", and save the public key

  6. Click the "Save private key", and save the private key "Private Key.ppk"

  7. Login and go to https://launchpad.net/~paulmarkcastillo/+editsshkeys

  8. Copy the Public Key from PuTTY Key Generator window, and paste it to the Launchpad

  9. Click "Import Public Key"

  10. I received an email about the new import (New SSH key added to your account).

  11. Open Pageant

  12. Click "Add Key"

  13. Browse thru my "Private Key.ppk"

  14. Enter my passphrase "password"

  15. Open command line

  16. Type "bzr launchpad-login paulmarkcastillo"

  17. Type "bzr info lp:bzr"

Here is the output :

Permission denied (publickey). ConnectionReset reading response for 'BzrDir.open_2.1', retrying Permission denied (publickey). bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.

How can I diagnose the problem?

هل كانت مفيدة؟

المحلول

To tell Bazaar to use putty, and thus access to the key cached by pageant, you need to set the BZR_SSH environment variable to point to plink.exe, for example:

set BZR_SSH=C:\Program Files\PuTTY\plink.exe

Also, it's probably not a problem, but I urge you to create a new key with 2048 bits encryption. When you open puttygen.exe, change the Number of bits in a generated key box from 1024 to 2048. 1024-bit keys are known to be insecure and automatically denied in modern systems. You will be more future proof with 2048-bit keys.

Finally, if the above still doesn't work, I recommend the following sanity check:

bzr config --remove launchpad_username --scope=bazaar
bzr info lp:bzr

This should work, regardless of your key setup. Later you can add back your launchpad username configuration by running bzr lp-login paulmarkcastillo again.

UPDATE

If you are using bzr from Git Bash or cygwin then be careful how you set BZR_SSH. If you set it using the environment variables screen, that should be fine. If you set it somewhere else, for example in ~/.profile, then you need to write it differently, for example in Git Bash:

BZR_SSH='/c/Program Files/PuTTY/plink.exe'
# or probably this works too
BZR_SSH='C:\Program Files\PuTTY\plink.exe'
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top