【问题标题】:Start ssh-agent when windows boots along with ssh passphraseWindows 启动时启动 ssh-agent 和 ssh 密码
【发布时间】:2020-08-26 16:26:45
【问题描述】:

我有一个私人 Github 存储库,我使用 windows 生成了 SSH 密钥。

我正在尝试在我的 windows 服务器启动时启动 ssh-agent,我可以使用以下命令..

start "" "%PROGRAMFILES%\Git\bin\sh.exe" --login -i

但问题是……每次重新启动时,我都需要输入 SSH 密钥的密码。

我正在使用 github 存储库,每当我们提交更改时,它都会触发服务器上的 GIT PULL(使用 webhook)。

无论如何我可以自动执行此操作?

【问题讨论】:

标签: github ssh continuous-integration


【解决方案1】:

您可以确保您的.profile(由sh --login -i 调用)包含call to ssh-agent with a file

cat passfile | ssh-add -p keyfile

这样,每次 shell 启动时,代理都会包含您的密钥及其密码。

【讨论】:

    猜你喜欢
    • 2019-02-06
    • 2013-09-23
    • 2015-05-07
    • 2021-10-26
    • 2021-11-27
    • 2018-03-31
    • 2014-09-16
    • 1970-01-01
    • 2023-01-28
    相关资源
    最近更新 更多