Jump to content

Pageant & PuTTY Made Portable

Recommended Posts

Please move this thread in example scripts section if you think it worth it (afaik I cannot post in it).

'PuTTY & Pageant Made Portable' aka PPMP



So here is the beginning of 3 busy evenings :P

I was tired of having to make all my PuTTY settings

every time I used a new computer. Moreover at the

end of the day I had to remove all the entries from

the registry if working on a shared computer.

Unfortunately, PuTTY is not portable and cannot be

used on a USB key, because it stores its settings

in the registry and not in a settings file.

Of course I used google and I find some PuTTY

mods that make it portable, but they are either

not updated, or do not include Pageant

I finally choose to make a kind of wrapper for

PuTTY & Pageant, in order to make them as portable

as possible.



* Load from/Save to file PuTTY settings

* Remove PuTTY settings from registry

- on quit

- closing pageant.exe (with PPMP)

* Auto save keylist on quit

* Prevent adding duplicate key filenames

* Try to automatically close Pageant when you

shutdown PPMP (and all PuTTY sessions if you

choose it)

User controls:


* Load/Save the keys list (add or replace list)

* Sort the keys list

* Drag and drop key(s) file in the list



* You choose to keep putty.exe and pageant.exe

in the same directory as PPMP, or you can put

them in the .\PuTTY subdirectory of PPMP.

PPMP will warn you if it cannot find these files.



* Take care of the executable names, they MUST be

"putty.exe" and "pageant.exe" (not case sensitive

as we work on windows).

* I do not see so far any random seed file values

in the registry (I am using the last version of

PuTTY, DevSnapShot 2007-03-12). If some errors are

related to this problem, please send me an email.

* As this tool plays with private key files I

intentionally do not provide any binary. Use the

AutoIt doc to run the script or to compile it.

* Thanks to the AutoIt forum users :D



* The key file consistency is not checked, so

Pageant may return some errors if you do not

have a valid key file.

Fix => Not planned because pageant does the job

* Do not save previous PuTTY settings in the

registry, so if someone else use the same

computer his settings will be deleted

Fix => just tell him to use PPMP :lmao:



Source code:


Comments are welcome & Have Phun :whistle:

Xavier (damajor)

Link to comment
Share on other sites

Nice script !!

I was thinking of doing something like that but now I don't have to bother anymore.

I had to make some adjustments to the script to make it work when first adding ppk keys to the list and then launching pageant and putty. I found that adding @ScriptDir to $gPageantPath and $gPuttyPath was necessary when the ppk key file was not in the same directory as the executables.

Lines 14 and 15 changed to:

Global $gPageantPath = @ScriptDir & "\PuTTY\pageant.exe"
Global $gPuttyPath =  @ScriptDir & "\PuTTY\putty.exe"oÝ÷ ظ§{]9r§çm¡«­¢+ØÀÌØíµ}±¥¹ôÀÌØíµ}±¥¹µÀìÌäìÅÕ½ÐìÌäìµÀì}U%
Ñɱ1¥ÍÑY¥ÝÑ%ѵQáÐ ÀÌØí1¥ÍÑY¥ÜÄ°ÀÌØí¤¤µÀìÌäìÅÕ½ÐìÌäoÝ÷ ظ§{]

The changes in lines 105, 108 and 110 are necessary when spaces are in the path.

Keep up the good work !

SKaLVaRo, just an AutoIt newbie.

Edit: Cleaned up codebits, backslashes where removed and single quotes were replaced with &Quote;

Edited by SKaLVaRo
Link to comment
Share on other sites

  • 2 weeks later...

Keep up the good work !

SKaLVaRo, just an AutoIt newbie.

Edit: Cleaned up codebits, backslashes where removed and single quotes were replaced with &Quote;

Thx for these comments :whistle: They are welcome.

I also find some issues wwhen I use the script compiled in exe. So I plan to publish another Q&D version the next week.

I will also think about a function to make the user to choose between overwritting the current putty setting or not (at launch time).

Perhaps also, as the key management, I will make a Putty conf management....

Too many ideas, not so much time :P

Link to comment
Share on other sites

Too many ideas, not so much time :shocked:

I know what you mean. Same problem here, I wanted to explore the PPMP functionality further but for now work comes first. I will normally have some more time in a couple of weeks.

In the mean time it's nice to see you still got great idea's to improve your work.


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...