gpt4 book ai didi

windows - 如何在 Windows 中列出加载的 SSH key (选美)

转载 作者:行者123 更新时间:2023-12-02 14:29:38 25 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





Run a batch file when Pageant finishes loading SSH keys

(2 个回答)


1年前关闭。




我正在尝试创建简单的 Windows 批处理脚本来管理与我们客户端的连接。这包括一些使用 plink.exe 的隧道。和 socks 链。每个跃点都需要我使用的 ssh key 身份验证 pageant.exe .

我根据需要编写了每件作品,除了我挣扎的选美部分。遇到的事实:

如果我只开始pageant.exe它将在没有加载任何 SSH key 的情况下启动选美代理,并且脚本将立即继续。然后我可以运行 pageant.exe my_key.ppk将 key 添加到选美中并提示密码,但是脚本也会同时继续,因此脚本将继续 plink 部分会失败,因为用户在此之前不会提供密码。

我一直在查看选美文档,发现了一些 CLI 开关,例如 -l据说应该列出加载的 key ,但这似乎不适用于 Windows 版本。似乎 Windows 版本只接受 .ppk 文件形式的参数

我想基本上做某种“等待”功能,直到用户提供密码。有什么方法可以直接从选美中列出加载的 key ,或者使用任何通用方法向 Windows 环境询问 SSH key ?

最佳答案

选美有 -c switch ,您可以使用它来传递要在加载私钥后执行的命令:

You can arrange for Pageant to start another program once it has initialised itself and loaded any keys specified on its command line. This program (perhaps a PuTTY, or a WinCVS making use of Plink, or whatever) will then be able to use the keys Pageant has loaded.

You do this by specifying the -c option followed by the command, like this:

C:\PuTTY\pageant.exe d:\main.ppk -c C:\PuTTY\putty.exe


虽然总的来说,Pageant 是一种交互式使用的工具,而不是用于编写脚本的工具。对于脚本,请使用 -i Plink 切换到 provide a private key for authentication .

关于windows - 如何在 Windows 中列出加载的 SSH key (选美),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53484559/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com