Permission denied (publickey)

Asked by dylanll

I am receiving an error when attempting to fetch source from bzr. Here is my terminal readout, my key is associated with my launchpad account, and I am prompted to unlock the public key with my secret key in a pop up box. Any ideas or help will be greatly appreciated.

dylan@Majuscule:/src$ sudo bzr branch lp:opencog
[sudo] password for dylan:
Permission denied (publickey).
bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.

RE: Martin Pool,

I originally ran it without sudo, but I believed I was getting an error when gpg tried to write to a file (come to think of it, i should have r/w access anyway). Perhaps I was mistaken, but here are my extended efforts.

dylan@Majuscule:/src$ bzr branch lp:opencog
bzr: ERROR: Permission denied: "/src/opencog/": [Errno 13] Permission denied: '/src/opencog/'
dylan@Majuscule:/src$ sudo !!
sudo bzr branch lp:opencog
Permission denied (publickey).
bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Martin Pool
Solved:
Last query:
Last reply:
Revision history for this message
Martin Pool (mbp) said :
#1

The problem is that the process running as root is probably trying to connect as root or something like that. There are ways to work around this but first, why are you running this as root?

Revision history for this message
Best Martin Pool (mbp) said :
#2

If your local account 'dylan' is supposed to have write access to
/src, then chmod/chown that directory appropriately.

For example,

 sudo chown dylan /src

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
dylanll (alphabethos) said :
#3

Thanks Martin Pool, that solved my question.

Revision history for this message
kesten broughton (dathomir) said :
#4

Hey, that solved it for me too.
Now I have to ask, why do all my default processes create files as owner root, group root?
Did i make a mistake during installation or something?

For example, I download panda3d .tar.gz from panda3d.org and save to disk
then i right click to get a context menu and choose "open with software center"

It creates all the files as owner, group = root

So when I try
 kesten$ bzr branch lp:~panda3d/panda3d/samples
i get permission denied /usr/share/panda3d/samples - starting the process as user "kesten" (before the prompt) I am not able to modify/create the samples directory

sudo bzr branch lp:~panda3d/panda3d/samples would presumeable be able to create/modify the directory, but it can't connect to Launchpad becase lp is expecting user kesten, not root. Have i got it right?

So my question is, if i'm user kesten, and i download a .tar.gz and open/install it with software center, why does it make root the owner and not kesten?

kesten

Revision history for this message
Martin Pool (mbp) said :
#5

On 18 November 2011 12:30, kesten broughton
<email address hidden> wrote:
> Question #99703 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/99703
>
> kesten broughton posted a new comment:
> Hey, that solved it for me too.
> Now I have to ask, why do all my default processes create files as owner root, group root?
> Did i make a mistake during installation or something?
>
> For example, I download panda3d .tar.gz from panda3d.org and save to disk
> then i right click to get a context menu and choose "open with software center"

Was it really a tar.gz, or a .deb file?
>
> It creates all the files as owner, group = root
>
> So when I try
>  kesten$ bzr branch lp:~panda3d/panda3d/samples
> i get permission denied /usr/share/panda3d/samples   - starting the process as user "kesten" (before the prompt) I am not able to modify/create the samples directory
>
> sudo bzr branch lp:~panda3d/panda3d/samples  would presumeable be able
> to create/modify the directory, but it can't connect to Launchpad becase
> lp is expecting user kesten, not root.  Have i got it right?

That is correct.

> So my question is, if i'm user kesten, and i download a .tar.gz and
> open/install it with software center, why does it make root the owner
> and not kesten?

If it's a .deb software package, then it's installed system wide, not
for your account, and therefore it's owned by root.

The short answer is that you probably want to check out the samples
directory in to your home directory, not into /usr, and then you won't
have a permissions problem. After you check them out you can copy
them, if you want to make them available to other people on the same
machine.

  bzr branch lp:~panda3d/panda3d/samples ~/panda-samples
  (optional):
  sudo cp -p ~/panda-samples /usr/share/panda3d/samples
--
Martin

Revision history for this message
Abdul Rauf (haseeb) said :
#6

Hi,
i am also getting the same error when i try to load the trunk. and here is the following error

bzr launchpad-login haseeb
[haseeb@localhost ~]$ bzr branch lp:gtg
Permission denied (publickey).
bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.

Revision history for this message
Martin Pool (mbp) said :
#7

@Abdul, as I said above, you need to make sure your ssh public key is registered with launchpad. See https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair

Revision history for this message
Pavlushka (pavelsayekat) said :
#8

Worked for me but my config file was in /etc/ssh/. Thanks Martin.

Revision history for this message
Vincent Ladeuil (vila) said :
#9

/etc/ssh is the system-wider config, user information should be recorded there since this is exposed to all users.

Revision history for this message
Pavlushka (pavelsayekat) said :
#10

Sorry Martin, you wanted to say should be or shouldn't be?