EGit(Eclipse git 插件)可以使用 SSH 密钥而不是用户名和密码吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5935378/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can EGit (Eclipse git plugin) use an SSH key instead of a username and password?
提问by Josh Glover
The git central repository to which I need to commit is configured using SSH keys. My username is jmglov
, but when I perform git operations (e.g. git clone
), I use this configuration:
我需要提交的 git 中央存储库是使用 SSH 密钥配置的。我的用户名是jmglov
,但是当我执行 git 操作(例如git clone
)时,我使用以下配置:
: jmglov@kitiara; cat .git/config
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:AwesomeWare
When I try to use EGitin Eclipseto push to the origin, I'm prompted for a password for the git
user, for which only SSH keypair authentication is enabled. My public key is one of the authorised keys for the git
user.
当我尝试在Eclipse 中使用EGit推送到源时,系统提示我输入用户密码,仅启用了 SSH 密钥对身份验证。我的公钥是用户的授权密钥之一。git
git
Is it possible to configure EGit to use my SSH key instead of the git
user's credentials?
是否可以将 EGit 配置为使用我的 SSH 密钥而不是git
用户的凭据?
回答by Robert Munteanu
Yes, the configuration is picked up from the Eclipse preferences, as noted in the EGit user guide
是的,配置是从 Eclipse 首选项中提取的,如EGit 用户指南中所述