Saturday, June 1, 2013

Putty: generating session configuration from code

I am an automation freak, and I hate doing manual copy and paste of information around.

I have to work on some 30 different accounts, so it's quite nice to store all this info in a CMDB and generate all the Putty session from it.

Unfortunately Putty uses the Windows Registry - which sucks. There are information on how to export this info, but I could not figure out how to store the hostname-username-password.

I find it much easier to bypass putty with MTPutty and generate myself the mtputty.xml file.
Here they explain how:

I am creating mtputty.xml myself. How can I encrypt my passwords?

You can use XML tag "PlainPassword" instead of "Password". Specify your password under this tag as a plaintext. When you quit MTPuTTY, PlainPassword will be removed automatically, but your password will be saved encrypted.

I will ignore the MTPutty/Servers/Putty section and do only the MTPutty/Internals/Putty/Node. Each node is like this:
<Node Type="1">
 <CLParams>-load PH30-0KWP355 -ssh -P 2228 -l oracle -pw *****</CLParams>

No comments: