My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
ConvertPuTTY  
How to run pwin2lin.pl to convert sessions
Updated Jun 22, 2010 by danwit...@gmail.com

Introduction

Help for running pwin2lin.pl to convert PuTTY sessions from Windows to Linux.

Details

Export the PuTTY registry settings from Windows: Click on Start -> Run

Type in 'regedit' and hit Enter.

Navigate to:

HKEY_CURRENT_USER\Software\SimonTatham\

Right click the 'PuTTY' folder and choose 'Export'. Save the registry file to your Linux machine and run pwin2lin from a shell (chmod 755 first):

./pwin2lin.pl

Examples:

Running the script alone:
foo\@bar:~\$ ./pwin2lin.pl

Specify files from the command line:
foo\@bar:~\$ ./pwin2lin.pl myPuttySessions.reg /home/foo/.putty
Comment by fvdho...@gmail.com, Feb 27, 2012

Thank you for this script.. works fine.

Frits.

Comment by dmitriy....@gmail.com, Oct 8, 2012

Thanks, it works!

Comment by ibmsorce...@gmail.com, Nov 6, 2012

Didn't work for me at first... Had to edit pwin2lin.pl file and change from UTF-16LE to UTF-8. Then it worked. Once was working, it's nice... saves me a lot of time as I had more than 100 servers in my putty list. Bruce

Comment by webmastir, Jan 9, 2013

Hell yes. I was just looking for something like this. Thanks!

Comment by webmastir, Jan 9, 2013

^...worked great btw.

Comment by deanhous...@gmail.com, Jan 9, 2013

Thanks for the great script. In case anyone is wondering, the output of this script goes into the ~/.putty/ folder.

Comment by snagin...@gmail.com, Jan 23, 2013

This worked great! thanks!

Comment by dsed...@dialone.com.ar, May 6, 2013

Didn't work for me. It creates the dir 'sessions' but it's empty.

Comment by derhan...@gmail.com, May 21, 2013

Works for me, but "(" and ")" characters in filenames are not converted to ASCII chars.

Comment by shawn.wh...@gmail.com, Jun 4, 2013

I had to log in and just say thank you! I was looking for a way to copy all 60 Cisco devices I had saved in my PuTTy connections, to my linux PC. This worked perfectly! Thank you, thank you, thank you.

Comment by mdinh...@gmail.com, Jun 6, 2013

Thank you !!!

Comment by michael....@gmail.com, Aug 1, 2013

Here's a command line method to generate the the registry key:

From the MS Windows Run dialog box, type: regedit /e "%userprofile%\desktop\putty.reg" HKEY_CURRENT_USER\Software\SimonTatham?

Comment by florinmu...@gmail.com, Sep 1, 2013

This works perfectly. Didn't think it was possible. Thanks a lot.

Comment by balabas...@gmail.com, Sep 17, 2013

thanx a lot!

Comment by caryl.wh...@mtecom.com, Oct 28, 2013

Had to change the name of a session that included a "/" and then it worked nicely. Thanks!

Comment by b4uist...@gmail.com, Nov 18, 2013

Awesome script! I think the comment about having to change from UTF-16LE to UTF-8 was a result of that person saving the .reg file as a plain .txt file? Also I had to change the PublicKeyFile?= path to a Linux path name instead of the Windows path name each session had, and while this would be a great option to add to the script, the existing script still saved me heaps of time and human error. A big thanks to the author :o)

Comment by b4uist...@gmail.com, Nov 18, 2013

Oh and I had to manually change the "FontName?=server:fixed" line to "FontName?=client:DejaVu? Sans Mono 14". I guess something is lost in the conversion so it defaults to "server:fixed". Again, another great feature to add if you're looking for ideas :P I'd make the changes myself, but my Perl is rusty (read: it's not bash, so I'm screwed).

Comment by linuxpro...@ukr.net, Dec 17, 2013

i use ubuntu 12 . and script didnt work for me

Comment by linuxpro...@ukr.net, Dec 17, 2013

is there anyone who tried to use this script on Debian 7 , or Ubuntu ??

Comment by linuxpro...@ukr.net, Dec 17, 2013

who can migrate this script to BASH ?

Comment by tganon...@gmail.com, Jan 16, 2014

Initially the script only created an empty 'sessions' directory. Turns out my registry keys were called [...]Simontatham[...], while the script assumes [...]SimonTatham?[...]. After changing the "T" from upper to lower case at approximately line 76 in pwin2lin.pl (search for e.g. "HKEY" in the script), it works perfectly (except the need for changing the path to the private key, as someone else mentioned). Thanks for the script - it saved me a lot of time.

Comment by ryanp...@gmail.com, Feb 19, 2014

Worked perfectly. Thanks!

Comment by gro...@gmail.com, Jun 5, 2014

great, works great !

Comment by glimen...@gmail.com, Mar 12, 2015

thank for your script.

I had to fix PublicKey? path (windows path) so I use this command line :

find . -type f -exec sed -i 's|PublicKeyFile?=C:\\\\dev\\\\|PublicKeyFile?=/home/myname/keys/|' {} \;

I hope it could be helpful

Powered by Google Project Hosting