[英]Start Pageant SSH-Agent and load all keys in a folder
How can i start the pageant ssh agent, and load all my private keys without adding them one by one to a batch file or in pageant itself?我如何启动选美 ssh 代理,并加载我所有的私钥而不将它们一个一个地添加到批处理文件或选美本身?
I can add key-files to pageant on the commandline by listing them after the executable or load them manually when pageant is already running.我可以在命令行上将关键文件添加到 pageant,方法是在可执行文件之后列出它们,或者在 pageant 已经运行时手动加载它们。 But there is no well documented way to load all the key-files in a folder on startup.但是没有详细记录的方法可以在启动时将所有密钥文件加载到文件夹中。
i assume you have putty and thus pageant installed and available in your PATH我假设你已经安装了腻子,因此在你的路径中安装了选美
C:\\Users\\[USER]\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup
.在 Windows 自动启动菜单中添加一个快捷方式: C:\\Users\\[USER]\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup
。powershell -Command "& pageant (Get-ChildItem [PATH TO KEYS]\\*.ppk)"
(preplace [PATH TO KEYS] with the path to your key-files ;)编辑快捷方式并输入powershell -Command "& pageant (Get-ChildItem [PATH TO KEYS]\\*.ppk)"
(将 [PATH TO KEYS] 放在您的密钥文件的路径;)On the next reboot pageant should be started up with all the ppk files in the linked folder.在下一次重新启动选美时,应使用链接文件夹中的所有 ppk 文件启动。
If you want to avoid the console window popup, get RunHiddenConsole
from https://github.com/SeidChr/RunHiddenConsole .如果您想避免控制台窗口弹出, RunHiddenConsole
从https://github.com/SeidChr/RunHiddenConsole获取RunHiddenConsole
。
powershellw -Command "& pageant (Get-ChildItem [PATH TO KEYS]\\*.ppk)"
更新powershellw -Command "& pageant (Get-ChildItem [PATH TO KEYS]\\*.ppk)"
的快捷方式May be this batch file should work.可能是这个批处理文件应该工作。 Have not tested though.虽然没有测试。
for %%i in (D:\location\to\private_keys\*.ppk) do start /B "" "%ProgramFiles%"\PuTTY\pageant.exe --encrypted %%i
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.