【问题标题】:Eclipse git and ssh-agentEclipse git 和 ssh-agent
【发布时间】:2019-01-19 11:57:17
【问题描述】:

我将 eclipse 与 git (egit) 一起使用。

我想使用我的 ssh-agent 以便可以从 Eclipse 推送。有人知道如何设置 egit 以使用 ssh-agent 吗?

背景:我无法将我的密钥上传到 Eclipse,因为我的密钥在密码棒上。我的 ssh-agent 可以在 opensc 的帮助下加载。

【问题讨论】:

    标签: eclipse git egit ssh-agent


    【解决方案1】:

    在您的 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,看看它是否抱怨主机。
    【解决方案2】:

    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
    

    (见EGit SSH configurationEGit FAQ, SSH Config

    【讨论】:

    【解决方案3】:

    不可能!这么多年的日食,仍然无法使用smartcardsssh/ssh-agent?真的很失望回到日食..

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=179924

    【讨论】:

      【解决方案4】:

      结帐cac-agent。它包括cac-ssl-relay,它可以作为来自任何需要 CAC 访问的客户端应用程序(包括 git/eclipse)的通用隧道。

      【讨论】:

        猜你喜欢
        • 2016-04-10
        • 2023-03-23
        • 2020-05-25
        • 1970-01-01
        • 1970-01-01
        • 2021-06-23
        • 1970-01-01
        • 1970-01-01
        • 2023-01-13
        相关资源
        最近更新 更多