【发布时间】:2019-01-19 11:57:17
【问题描述】:
我将 eclipse 与 git (egit) 一起使用。
我想使用我的 ssh-agent 以便可以从 Eclipse 推送。有人知道如何设置 egit 以使用 ssh-agent 吗?
背景:我无法将我的密钥上传到 Eclipse,因为我的密钥在密码棒上。我的 ssh-agent 可以在 opensc 的帮助下加载。
【问题讨论】:
标签: eclipse git egit ssh-agent
我将 eclipse 与 git (egit) 一起使用。
我想使用我的 ssh-agent 以便可以从 Eclipse 推送。有人知道如何设置 egit 以使用 ssh-agent 吗?
背景:我无法将我的密钥上传到 Eclipse,因为我的密钥在密码棒上。我的 ssh-agent 可以在 opensc 的帮助下加载。
【问题讨论】:
标签: eclipse git egit ssh-agent
在您的 Eclipse 启动脚本或 .profile(或任何地方)中,在启动 Eclipse 之前添加 export GIT_SSH=/usr/bin/ssh。然后 Eclipse 使用使用 ssh 代理的默认 ssh,即使您的密钥在智能卡上,您也可以在 Eclipse 中运行 pull 和 push 命令。
编辑:GIT_SSH 由 eclipse 的 egit 解释,但也由独立的 git 解释。将其设置为 /usr/bin/ssh 会将其设置为独立 git 的默认值,因此只有 egit 会改变它的行为。
【讨论】:
.profile 中设置了GIT_SSH 并且Eclipse 抱怨缺少/usr/bin/ssh-askpass,请确保您的.ssh/known_hosts 中没有冲突。例如,在同一个 Git 工作副本的终端中尝试git fetch,看看它是否抱怨主机。
2016 年 6 月更新(4 年后):Gunnar Wagenknecht 现在提到 in the comments:
现在可以在 Eclipse Neon 中使用项目
eclipseguru/eclipse-jsch-agent-proxy、Eclipse ssh-agent 和 Pageant 支持。
旧 Eclipse 版本的一种解决方法是通过设置 GIT_SSH 环境变量来使用本机 OS SSH 客户端而不是 Eclipse 内置客户端:
export GIT_SSH=/usr/bin/ssh
【讨论】:
不可能!这么多年的日食,仍然无法使用smartcards 和ssh/ssh-agent?真的很失望回到日食..
【讨论】:
结帐cac-agent。它包括cac-ssl-relay,它可以作为来自任何需要 CAC 访问的客户端应用程序(包括 git/eclipse)的通用隧道。
【讨论】: