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:
Open PuTTYgen
Click "Generate"
Move around the mouse pointer
Add a passphrase "password"
Click the "Save public key", and save the public key
Click the "Save private key", and save the private key "Private Key.ppk"
Login and go to https://launchpad.net/~paulmarkcastillo/+editsshkeys
Copy the Public Key from PuTTY Key Generator window, and paste it to the Launchpad
Click "Import Public Key"
I received an email about the new import (New SSH key added to your account).
Open Pageant
Click "Add Key"
Browse thru my "Private Key.ppk"
Enter my passphrase "password"
Open command line
Type "bzr launchpad-login paulmarkcastillo"
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 toplink.exe
, for example: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:
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
fromGit Bash
orcygwin
then be careful how you setBZR_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: