来自 Windows 服务的 Plink 找不到 Pageant [英] Plink from Windows service cannot find Pageant
本文介绍了来自 Windows 服务的 Plink 找不到 Pageant的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 Windows 服务,它将使用 plink.exe
进行 SSH 连接,但我发现 Plink 找不到正在运行的 Pageant.
I have one windows service which will use plink.exe
for SSH connection and I found that Plink cannot find the running Pageant.
这是我目前完成的步骤.
Here is the steps I have done so far.
- 安装 Windows 服务以作为特定用户运行
- 在启动 Windows 服务之前,我以该用户身份登录并使用 PuTTY 生成的密钥启动 Pageant.
- 然后我启动了 Windows 服务(但我无法让它工作,因为 Plink 找不到 Pageant 和服务器回复,因为没有可用的支持身份验证方法.)
注意:如果我使用该用户将 Windows 服务作为控制台应用程序运行,则一切正常.
推荐答案
我通过不使用代理而是直接将私钥和密码传递给plink.exe
设法解决了该问题.通过这样做,我可以在不使用 pageant
的情况下运行.
I managed to solve the issue by not using agent but directly passed the private key and password to plink.exe
. By doing that, I'm able to run without using pageant
.
在没有代理的情况下启动plink.exe
;
To start plink.exe
without agent;
plink.exe -noagent -i private_key.ppk -pw mypassword -P 1234 user@host.com
这篇关于来自 Windows 服务的 Plink 找不到 Pageant的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文