简体   繁体   English

启动 Pageant SSH-Agent 并将所有密钥加载到一个文件夹中

[英]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我假设你已经安装了腻子,因此在你的路径中安装了选美

  1. add a shortcut in you windows autostart menu: C:\\Users\\[USER]\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup .在 Windows 自动启动菜单中添加一个快捷方式: C:\\Users\\[USER]\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup
  2. edit the shortcut and enter 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] 放在您的密钥文件的路径;)
  3. (optional) update the image of the shortcut to anything more appropriate (可选)将快捷方式的图像更新为更合适的任何内容
  4. click ok.单击确定。

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 .如果您想避免控制台窗口弹出, RunHiddenConsolehttps://github.com/SeidChr/RunHiddenConsole获取RunHiddenConsole

  1. rename the hiddenw.exe to powershellw.exe or pwshw.exe (whatever shell you are using) and put the file in a folder that is listed in your PATH将 hiddenw.exe 重命名为 powershellw.exe 或 pwshw.exe(无论您使用的是什么外壳)并将文件放入路径中列出的文件夹中
  2. update the shortcut to powershellw -Command "& pageant (Get-ChildItem [PATH TO KEYS]\\*.ppk)"更新powershellw -Command "& pageant (Get-ChildItem [PATH TO KEYS]\\*.ppk)"的快捷方式
  3. click ok单击确定

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.

相关问题 如何使用JMeter在Pageant中加载SSH密钥 - How can I use JMeter to load SSH keys in Pageant Windows OpenSSH ssh-agent 服务在哪里偷偷存放私钥 - Where does Windows OpenSSH ssh-agent service secretly store private keys 每次我启动git-bash时都需要发出ssh-agent命令 - Need to issue ssh-agent command every time I start git-bash 当 Pageant 完成加载 SSH 密钥时运行批处理文件 - Run a batch file when Pageant finishes loading SSH keys 使用 cygwin ssh-agent 正在运行,但 git 仍在提示输入密码 - Using cygwin ssh-agent is running but git is still prompting for passphrase 共享 ssh-agent - windows 服务,msys2 shell - Share ssh-agent - windows service, msys2 shell 在使用本机 OpenSSH 的 ssh-agent 配置良好的 Windows 10 上,如何使用配置的 ssh-agent 实现 git? - On Windows 10 that is well configured with native OpenSSH's ssh-agent, how to have an implementation of git use the ssh-agent configured? sh脚本不会将ssh密钥添加到ssh-agent(windows git bash) - sh script doesn't add ssh key to ssh-agent (windows git bash) gitbash(缓存密码短语密钥):无法使ssh-agent在Windows上运行,已修改.bashrc和.profile - gitbash (cache passphrase key): Can't get the ssh-agent to run on windows, modified the .bashrc & .profile Jenkins,git'高级'命令(fetch,diff等)和ssh-agent(Windows Server) - Jenkins, git 'advanced' commands (fetch, diff etc) and ssh-agent (Windows Server)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM