Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial, authentication by key

Tags:

ssh

mercurial

I have such section in my ~/.hgrc config file

[auth]
repo.prefix = ssh://[email protected]/repos
repo.key = /home/zerkms/.ssh/mercurial-repo/id_rsa

But when I write:

hg clone ssh://[email protected]/repos/rps .

mercurial still requires password to enter.

What have I done wrong?

To prevent obvious questions:

Yes, there is a valid key in the specified path and it works if use it with ssh-agent.

My question is how to work with keys in [auth] section.

like image 544
zerkms Avatar asked Nov 15 '10 05:11

zerkms


1 Answers

auth isn't for SSH. The key needs to be loaded in another way. If it were just ~/.ssh/id_rsa it would be done automatically, as it's not you may need to do something to register it. Using ~/.ssh/id_rsa is the easiest way normally - put the contents of ~/.ssh/id_rsa.pub in ~/.ssh/authorized_keys on the target machine and you're ready.

like image 189
Chris Morgan Avatar answered Nov 12 '22 16:11

Chris Morgan