-
Star
(126)
You must be signed in to star a gist -
Fork
(19)
You must be signed in to fork a gist
-
-
Save chunter/3ec25dd802c2163265eacfcb6f53cb7d to your computer and use it in GitHub Desktop.
To make Pageant automatically run and load keys at startup: | |
- Find the location of pageant.exe | |
- Windows key + R to open the 'run' dialog box | |
- Type: 'shell:startup' in the dialog box | |
- Create a shortcut to the pageant.exe and put into this startup folder. | |
- Right click on the shortcut and open 'Properties' | |
- In 'Target' add: "<route to>/pageant.exe" myprivatekeyname.ppk | |
- In 'Start in' add: "<route to myprivatekeyname.ppk>" | |
- Click on the shortcut link and check that Pageant has started and has loaded your keys |
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] "Pageant"="cmd /c "for %i in ("%USERPROFILE%\*.ppk") do start "%ProgramFiles%\PuTTY\pageant.exe" "%i"""
A variation of @xkolk approach above, but with support for loading multiple keys:
Use this on the command line, as a startup command in your registry, or from the command line (just the stuff between the first and last quotes):
cmd /V:ON /c "set keys= && (for %i in ("%PATH_TO_YOUR_PPK_FILES%\*.ppk") do (set keys=!keys! %i)) && start "" "C:\Program Files\PuTTY\pageant.exe" --encrypted !keys!"
The use of
--encrypted
will cause pageant to load without asking for any passwords. Then, on first use, it will ask for the password(s) and keep the keys decrypted in memory.
Very useful. Thank you both @xkolk and @brunokc.
Cheers.
You may also find this guide for setting up KeePass + KeeAgent for WSL 2 SSH interesting:
https://gist.github.com/strarsis/e533f4bca5ae158481bbe53185848d49