将 sudo 与 mercurial 和 ssh 身份验证一起使用 [英] using sudo with mercurial and ssh authentication

查看:37
本文介绍了将 sudo 与 mercurial 和 ssh 身份验证一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么跑
ssh-添加密钥
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 clone hg@bitbucket.org/etc/etc 一起使用时,在我将密钥添加到我的用户帐户后它不起作用.我记得这是因为 sudo 以超级用户身份运行,但该用户无法添加密钥.我记得设置了一些指令(我使用 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 的回答为我指明了正确的方向,但我发现至少在 Hg 的当前版本(1.6.4)下,你需要把 --ssh(或等效的-e) 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆