Reputation: 254886
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.
Upvotes: 15
Views: 16796
Reputation: 1418
The following works for me (probably a new setting since the question was asked):
Add to hgrc:
[ui]
ssh = ssh -C -i ~/.ssh/id_rsa-mercurialkey
-C to enable compression, -i to specify identity file. If the key is loaded into ssh-agent, I don't get asked again for passphrase.
Upvotes: 22
Reputation: 90712
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.
Upvotes: 15