Table of Contents
Problem
How to export / import / migrate / transfer PuTTY sessions list from Windows to Linux.
Transfer PuTTY sessions list from Windows to Windows
PuTTY stores the session information in the registry on Windows OS by default.
Export PuTTY sessions list using cmd.exe require elevated prompt
Only sessions: regedit /e "%USERPROFILE%\Desktop\putty-sessions.reg" HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions
All settings: regedit /e "%USERPROFILE%\Desktop\putty.reg" HKEY_CURRENT_USER\Software\SimonTatham
Export PuTTY sessions list using Powershell
Only sessions: reg export HKCU\Software\SimonTatham\PuTTY\Sessions ([Environment]::GetFolderPath("Desktop") + "\putty-sessions.reg")
All settings: reg export HKCU\Software\SimonTatham ([Environment]::GetFolderPath("Desktop") + "\putty.reg")
Import PuTTY sessions list
Double-click on the *.reg file and accept the import.
Import PuTTY sessions list using cmd.exe require elevated command prompt
regedit /i putty-sessions.reg
regedit /i putty.reg
Import PuTTY sessions list using PowerShell
reg import putty-sessions.reg
reg import putty.reg
Note: do not replace SimonTatham with your username.
Note: It will create a reg file on the Desktop of the current user.
Note: It will not export-related SSH keys.
Transfer PuTTY sessions list from Linux to Linux
On Linux / Unix, all PuTTY sessions list profile are stored in: ~/.putty/sessions/
(where ~ represents the user’s home directory)
Each session is a file in that directory, so you can copy the whole directory or just individual sessions.
Note: Private key files are not stored within the session files, so they will also need to be copied from their original location.
Transfer PuTTY sessions list from Windows to Linux
Step 1: Download pwin2lin.pl on Linux.
# wget https://pwin2lin.googlecode.com/files/pwin2lin.pl
Step 2: Install PuTTY on Linux.
# wget http://the.earth.li/~sgtatham/putty/latest/putty-0.63.tar.gz
# tar zxvf putty-0.63.tar.gz
# cd putty-0.63/
# ./configure
# make; make install
Step 3: Export Windows registry containing PuTTY sessions.
E:\Linux>regedit /e "E:\Linux\putty.reg" "HKEY_CURRENT_USER\Software\SimonTatham\PuTTY"
Step 4: Import to Linux.
[oracle@rac01 ~]$ cp /media/sf_Linux/putty.reg .
[oracle@rac01 ~]$ ll putty.reg
-rwxr-x--- 1 oracle dba 15376 Jun 6 21:05 putty.reg
[oracle@rac01 ~]$ ./pwin2lin.pl ./putty.reg ~/.putty
mkdir /home/oracle/.putty
mkdir /home/oracle/.putty/sessions
[oracle@rac01 ~]$ cd .putty/sessions/
[oracle@rac01 sessions]$ ll
total 8
-rw-r--r-- 1 oracle dba 4257 Jun 6 21:06 rac01
[oracle@rac01 sessions]$h