Sou*_*aws 35 ssh powershell openssh windows-10 windows-10-v1803
在我的 Ubuntu 机器上,我只是使用 Keychain 来维护一个保持登录状态的 ssh-agent。
我想要类似于 Windows 上的东西,因为 OpenSSH 是本机包含的。我正在使用带有众所周知的if [ -z "$SSH_AUTH_SOCK" ] ; then ...脚本的Git Bash,但这导致许多 ssh 代理被打开,我知道有人建议不要这样做(部分原因是这篇博文:http : //rabexc.org/posts/pitfalls-of-ssh -agents ) - 这就是让我获得 Ubuntu 钥匙串的原因。不再使用它的另一个原因是我正在将 PowerShell 作为我的主要 shell。
但我不确定如何在 Windows 上专门使用 PowerShell和Win32-OpenSSH实现同样的事情。
谢谢!
Dav*_*dal 34
您必须将 OpenSSH Authentication Agent 服务配置为自动启动(或者您可以在每次首次打开 powershell 时手动启动它:Start-Service ssh-agent)。
之后,您只需ssh-add C:\path\to\your\ssh\key\id_rsa要做一次。之后,每次启动 ssh-agent 时,密钥都会在那里。您可以使用ssh-add -l.
编辑:要让 SSH 代理自动启动 Windows,您可以Set-Service ssh-agent -StartupType Automatic在超级用户 powershell 提示符下运行。
| 归档时间: |
|
| 查看次数: |
37441 次 |
| 最近记录: |