使用sudo与mercurial和ssh认证 [英] using sudo with mercurial and ssh authentication
问题描述
如何运行
ssh-add key
sudo hg clone hg@bitbucket.org/etc/etc
但使用我的ssh密钥而不是超级用户。
How do i run
ssh-add key
sudo hg clone hg@bitbucket.org/etc/etc
but use my ssh keys and not the superusers.
嘿,大家,当我以sudo为例, sudo hg克隆hg@bitbucket.org/etc/etc后,我添加了一个密钥到我的用户帐户它不工作。我记得这是因为sudo作为超级用户运行,但该用户不能添加密钥。我记得设置一些指令(im使用debian),允许我以sudo的形式运行该命令,但仍然有我的ssh密钥取自我的普通用户帐号,但我没有在当时记下它。谢谢。
Hey everyone, when i use sudo with for example, sudo hg clone hg@bitbucket.org/etc/etc after i have added a key to my user account it doesnt work. I remember this is because the sudo is ran as the superuser but that user cannot have keys added to it. I remember setting some directive (im using debian) that allowed me to run that command as sudo, but still have my ssh keys taken from my normal user account but i didnt make a note of it at the time. Thanks.
推荐答案
Ry4an的答案指向我正确的方向,但我发现使用当前版本(1.6.4)至少需要将 - ssh
(或等效的 -e
) / em> hg命令。
The answer by Ry4an pointed me in the right direction but I found that with the current version (1.6.4) of Hg at least, you need to put --ssh
(or the equivalent -e
) after the hg command.
例如
hg clone -e 'ssh -i /path/to/key' ssh://user@host/path
这篇关于使用sudo与mercurial和ssh认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!