Permission denied (public key) when pushing and checking out a branch

Asked by vinithra

I am trying to update a branch with some local changes.

I first tried: bzr branch lp:<branch-name>
which worked fine. After making my changes, I tried: bzr push lp:<branch-name>
This resulted in:
Permission denied (publickey). < 0KB 0KB/s |
bzr: ERROR: Connection closed: please check connectivity and permissions

I then tried to checkout the branch instead of creating a local branch by doing: bzr checkout lp:<branch-name>
which resulted in the same Permission denied error.

I am on a Windows XP machine and using bazaar 2.0. For setup, I followed the instructions in
1) I generated a SSH-2 RSA key pair with 1024 bits in the generated key using Putty key generator. I saved the private and public key.
2) I copied the public key from the Putty keygen textbox into the box in "Change your SSH keys" (including ssh-rsa at the start and == rsa-key-<date> at the end) and pressed Import public key. That seems to have worked. I have only one SSH key imported into launchpad.
3) I right-clicked Pageant and added the private key. "View keys" displays the one private key
4) In the command window, I set: bzr launchpad-login vinithrav
When I try: bzr launchpad-login
I get my username back. I also did: bzr whoami <myemailaddress>

<User>\Application Data\bazaar\2.0\authentication.conf file has user=vinithrav which is correct. In the same location, bazaar.conf has launchpad_username = vinithrav.

After all this I tried push and checkout as described above, which failed.

Can anyone kindly help me through this? Thanks for your time!

Question information

English Edit question
Launchpad itself Edit question
Tim Penhey Edit question
Solved by:
Last query:
Last reply:
Tim, could you take a look at this please?
Revision history for this message
Tim Penhey (thumper) said :

It seems that you have followed all the steps.

The only problem appears to be that bzr is not passing your correct key when trying to talk to launchpad. That is why you are seeing the "Permission denied (publickey)" error.

Unfortunately I don't have any experience with using Bazaar with Windows.

I'll try to chase up some answers.

Revision history for this message
vinithra (vinithrav) said :

Hi Tim,

Any luck finding any possible solutions?

Thanks again for your time.


Revision history for this message
Alexander Belchenko (bialix) said :

I've just tested the steps and it works for me. Please check again but with environment variable BZR_SSH set to paramiko. You can set this variable via Start -> Settings -> Control Panel -> System -> Advanced -> Environment variable or in command line with command:

set BZR_SSH=paramiko

In the latter case it will work during current shell session though.

Revision history for this message
vinithra (vinithrav) said :

I tried installing Bazaar from scratch and used version 1.17 as opposed to 1.16, which was the latest version last time. I followed the same steps as last time and things worked smoothly this time. I am able to commit via the console and using the Bazaar windows GUI. I did not have to set the BZR_SSH env var. Thanks for your help though!

Revision history for this message
dirk (australiandeveloper) said :

I had the same problem after following the same steps, and after installing the latest version of Bazaar it was still failing. In the end I just needed to set the BZR_SSH environment variable as described above. Now it works.
What does the environment variable do?

Revision history for this message
Alexander Belchenko (bialix) said :

Environment variable forces usage of specific SSH client in Bazaar.

Revision history for this message
Kayode Odusote (odusote-kayode) said :

How does one set the environment variable for Bazaar in Ubuntu? I have the same problem of Permission denied (public key) whilst trying to checkout a branch. I am using Ubuntu 10.10 and have two branches on the same machine. The first branch I set up works every well and it updates without a problem but I have not been able to checkout the second branch on my system. It returns the error - permission denied (public key).

Revision history for this message
Tim Penhey (thumper) said :


Please start new questions rather than add onto an older not really related one.

Getting a checkout of a branch implies you need write access. To just get a copy of the branch, use "branch" or "get.

Revision history for this message
Amit Rasmiya (OpenERP) (ram-openerp) said :

getting publickey error while using this command ( bzr branch lp:openobject-addons). can anyone help me?

Revision history for this message
Voidcode (terkelsorensen) said :

I get this error to!!