damajor Posted March 14, 2007 Share Posted March 14, 2007 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 PPMPStory:~~~~~~So here is the beginning of 3 busy evenings I was tired of having to make all my PuTTY settingsevery time I used a new computer. Moreover at theend of the day I had to remove all the entries fromthe registry if working on a shared computer.Unfortunately, PuTTY is not portable and cannot beused on a USB key, because it stores its settingsin the registry and not in a settings file.Of course I used google and I find some PuTTYmods that make it portable, but they are eithernot updated, or do not include PageantI finally choose to make a kind of wrapper forPuTTY & Pageant, in order to make them as portableas possible.Automation:~~~~~~~~~~~* 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 youshutdown PPMP (and all PuTTY sessions if youchoose it)User controls:~~~~~~~~~~~~~~* Load/Save the keys list (add or replace list)* Sort the keys list* Drag and drop key(s) file in the listConfig:~~~~~~~* You choose to keep putty.exe and pageant.exein the same directory as PPMP, or you can putthem in the .\PuTTY subdirectory of PPMP.PPMP will warn you if it cannot find these files.Comments:~~~~~~~~~* Take care of the executable names, they MUST be"putty.exe" and "pageant.exe" (not case sensitiveas we work on windows).* I do not see so far any random seed file valuesin the registry (I am using the last version ofPuTTY, DevSnapShot 2007-03-12). If some errors arerelated to this problem, please send me an email.* As this tool plays with private key files Iintentionally do not provide any binary. Use theAutoIt doc to run the script or to compile it.* Thanks to the AutoIt forum users Issues:~~~~~~~* The key file consistency is not checked, soPageant may return some errors if you do nothave a valid key file.Fix => Not planned because pageant does the job* Do not save previous PuTTY settings in theregistry, so if someone else use the samecomputer his settings will be deletedFix => just tell him to use PPMP Screenshot:Source code:PPMP.au3Comments are welcome & Have Phun Xavier (damajor) Link to comment Share on other sites More sharing options...
SKaLVaRo Posted March 16, 2007 Share Posted March 16, 2007 (edited) 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 March 16, 2007 by SKaLVaRo Link to comment Share on other sites More sharing options...
damajor Posted March 29, 2007 Author Share Posted March 29, 2007 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 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 Link to comment Share on other sites More sharing options...
SKaLVaRo Posted April 6, 2007 Share Posted April 6, 2007 Too many ideas, not so much time 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.SKaLVaRo Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now