Export PuTTY sessions from HKCU\Software\SimonTatham\PuTTY\Sessions and import the .reg file under the destination Windows user. Export the parent PuTTY key for the broader configuration, including cached SSH host keys. These commands apply to standard PuTTY on Windows; portable wrappers and Unix builds can use different storage.
How do I export and import PuTTY settings?
In Command Prompt, run the export on the old machine:
reg export "HKCU\Software\SimonTatham\PuTTY" "%USERPROFILE%\putty-backup.reg"
Copy that file privately to the destination user's profile folder. Back up that user's existing PuTTY settings before merging, inspect the file, then run:
reg import "%USERPROFILE%\putty-backup.reg"
In PowerShell, use its environment-variable syntax instead:
reg export "HKCU\Software\SimonTatham\PuTTY" "$env:USERPROFILE\putty-backup.reg"reg import "$env:USERPROFILE\putty-backup.reg"Run each command in its indicated shell. %USERPROFILE% is CMD syntax; PowerShell uses $env:USERPROFILE. An export/import into your own writable HKCU key normally does not require an administrator account. Check the command's success message before moving on.
Jump to:
- Where PuTTY stores its data
- Export everything with regedit
- Import on the target machine
- Export only the saved sessions
- Export with PowerShell
- Verify the export worked
- Transferring between user accounts
- Troubleshooting: Access Denied and other errors
- Modern alternatives to PuTTY
- FAQ
Where PuTTY stores its data
The standard Windows registry layout:
| Registry key | Contains |
|---|---|
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY | Root of all PuTTY data for the current user |
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions | Each saved session as a subkey (one subkey per session name) |
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys | Cached host keys (the "key fingerprint accepted" warnings you've previously dismissed) |
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Jumplist | Recent connections shown in the Windows taskbar context menu |
This is the standard Windows PuTTY configuration location. Private .ppk keys and log files are separate files; their paths in a saved session do not copy their contents. Transfer needed private keys separately and protect them as credentials.
Open regedit.exe, navigate to HKEY_CURRENT_USER\Software\SimonTatham\PuTTY, and you can see the whole thing in the tree. The Sessions subkey is where the "Saved Sessions" list in PuTTY's launch dialog comes from.
Export everything with regedit
Press Win+R, type cmd, press Enter. Then:
regedit /E "%USERPROFILE%\Documents\putty-full.reg" "HKEY_CURRENT_USER\Software\SimonTatham\PuTTY"
regedit /E exports a registry key to a .reg file. The flags:
/E, export mode- First argument, output file path (quoted to handle spaces in usernames)
- Second argument, the registry key to export
After it runs (silently, no progress dialog), Documents\putty-full.reg will contain every PuTTY session, host-key cache, and preference. Open it in Notepad to verify; you should see a [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY] block at the top and a long list of [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\<session-name>] blocks below it.
The file is readable text and can expose hostnames, usernames, proxy settings, and trusted host keys. Keep the backup private and inspect it before import; a .reg file can modify registry values beyond PuTTY if someone has changed its contents.
Import on the target machine
On the destination Windows machine, copy the .reg file over (USB stick, OneDrive, scp, however you move files). Then either:
Option A, interactive merge:
Double-click the .reg file. Windows shows a "Registry Editor, Are you sure you want to continue?" dialog. Click Yes. The settings merge into HKEY_CURRENT_USER\Software\SimonTatham\PuTTY.
Option B, silent merge from Command Prompt:
regedit /S "%USERPROFILE%\Documents\putty-full.reg"
/S (silent) skips the confirmation dialog. Useful for scripting.
After the merge, open PuTTY, the saved sessions list should now show every session from the source machine.
Important caveat about merge semantics: regedit /S MERGES the keys; it doesn't replace them. If the target machine has session "production" and the import also has "production", the imported version wins. If the target has session "staging" that's not in the import, "staging" is left alone. Back up the destination settings first. Do not delete the whole PuTTY key merely to add sessions.
Export only the saved sessions
If you want to back up just your session list (no host keys, no global preferences), target the \Sessions subkey:
regedit /E "%USERPROFILE%\Documents\putty-sessions.reg" "HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions"
This is what you want when migrating between machines but each machine has its own host-key cache (and you don't want to override them) or its own global preferences.
To export a single session by name, drill down further:
regedit /E "%USERPROFILE%\Documents\production-session.reg" "HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\production"
PuTTY encodes spaces in session names as %20 in the registry path, so a session named "Production Server" lives at \Sessions\Production%20Server.
Export with PowerShell
Call the Windows reg.exe program from PowerShell:
$dest = "$env:USERPROFILE\Documents\putty-full.reg"
reg export "HKCU\Software\SimonTatham\PuTTY" $dest /yThe /y flag overwrites the file without prompting. HKCU is shorthand for HKEY_CURRENT_USER.
For a sessions-only PowerShell export:
reg export "HKCU\Software\SimonTatham\PuTTY\Sessions" "$env:USERPROFILE\Documents\putty-sessions.reg" /yThe PowerShell-native cmdlets (Get-ItemProperty, Export-Clixml) work too but produce a non-.reg format that won't import via double-click. Stick with reg export for portability.
Verify the export worked
A .reg file should:
- Contain the sessions you selected; file size alone does not prove that the backup is complete.
- Start with
Windows Registry Editor Version 5.00on the first line. - Contain at least one
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\<name>]block.
Quick check from cmd:
type "%USERPROFILE%\Documents\putty-full.reg" | findstr /R "^\["
That prints every section header in the file, one line per session and one for each subkey. Count the lines to confirm everything is captured.
From PowerShell:
Select-String -Path "$env:USERPROFILE\Documents\putty-full.reg" -Pattern '^\['Transferring between user accounts
PuTTY's data is per-user (in HKEY_CURRENT_USER), so two accounts on the same machine have completely separate PuTTY configurations. To copy from User A to User B on the same Windows install:
- Sign in as User A.
- Export to a path readable by User B, somewhere outside User A's profile, like
C:\Temp\putty.reg. - Sign in as User B.
- Open the file, merge it.
If you forget step 2 and export into User A's Documents, User B won't have read access by default. Either re-export to a shared location or copy the file to C:\Temp first as an administrator.
Same principle for transferring between machines: the .reg file is portable; the destination user account writes its own copy into its own HKEY_CURRENT_USER.
Troubleshooting: Access Denied and other errors
"Access is denied" when running regedit /E. Two common causes:
- The target file location requires admin rights (e.g., writing to
C:\Program Files). Choose a path under%USERPROFILE%instead. - The registry key path is wrong, with backslashes missing or doubled. Verify by opening
regedit.exeand navigating to the path manually, if it doesn't exist, your command will fail silently.
"The specified file does not contain a valid registry script" when merging. The .reg file got corrupted in transit, usually because it was opened and saved by an editor that converted UTF-16 to UTF-8 or stripped the BOM. Re-export and copy with binary-mode tools (Robocopy, SCP with -r, USB).
Imported but PuTTY shows no new sessions. Import under the account that runs PuTTY. Elevation with the same account does not automatically select a different profile, but supplying another account's credentials can. Verify the current user and HKCU path.
Selective import shows registry path errors. PuTTY session names with spaces or special characters are URL-encoded in the registry path (%20 for space, %2E for .). When editing a .reg file to subset its sessions, preserve the encoding exactly.
Host-key warnings reappear after import. A sessions-only backup does not include trusted host keys. Check that the hostname, port, and key type match the connection you backed up. Independently verify a changed server fingerprint; deleting the trust cache or accepting a new key blindly is not a migration fix.
Modern alternatives to PuTTY
In 2026, Windows has built-in alternatives that don't store configuration in the registry and migrate more cleanly:
- OpenSSH client (built into Windows 10 1809+ and all of Windows 11). Configuration in
%USERPROFILE%\.ssh\config, a plain text file that copies between machines and version-controls trivially. - Windows Terminal with OpenSSH profiles, settings in
settings.jsonunder%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\. - MobaXterm, a richer PuTTY replacement with a built-in file manager, X11 forwarding, and the ability to export sessions to a single portable file.
- WSL2 + OpenSSH, Linux-native ssh tooling with full bash,
~/.ssh/config, and standard Unix workflows.
If you're starting fresh on a new Windows machine and not bound by existing PuTTY sessions, OpenSSH + ~/.ssh/config is the cleaner long-term setup. For migrating existing PuTTY users, the registry export above remains the fastest path.
What to do next
For broader DevOps reference:
- Tor Country Codes for ExitNodes, ExcludeNodes, and torify, also config-file driven, also lots of registry/file gotchas.
For backup workflows in adjacent stacks:
- How to Export All MySQL Databases with mysqldump, the database equivalent of "back up everything to one portable file".
FAQ
In the Windows registry at HKEY_CURRENT_USER\Software\SimonTatham\PuTTY. Saved sessions live in the \Sessions subkey, cached host keys in \SshHostKeys, recent-connection jumplist in \Jumplist.
This describes standard Windows PuTTY. Private key files are separate; portable wrappers and non-Windows builds may use different storage.
Run regedit /E "%USERPROFILE%\Documents\putty-sessions.reg" "HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions" from cmd. That writes a .reg file containing only your saved sessions (not host keys or global preferences).
For a full backup including host keys and preferences, target the parent \PuTTY key instead of \Sessions.
For standard Windows PuTTY, export the registry configuration as shown above. Check the storage location if you use a portable wrapper or another SSH client.
Other SSH clients have their own import and export formats; a PuTTY registry backup is not a universal session file.
Copy the .reg file to the target Windows machine. Double-click it and confirm the "Are you sure you want to continue?" dialog. The settings merge into HKEY_CURRENT_USER\Software\SimonTatham\PuTTY. Open PuTTY and the imported sessions will appear in the Saved Sessions list.
For a silent import (no confirmation dialog), run regedit /S "path\to\file.reg".
Two common causes. First, the output path requires admin write access (e.g., C:\Program Files or C:\ directly). Switch to a path under %USERPROFILE%, choose an existing folder you can write to.
Second, the registry path in the command is wrong. Open regedit.exe manually and navigate to HKEY_CURRENT_USER\Software\SimonTatham\PuTTY. If it doesn't exist there, you don't have any PuTTY data to export (you'd need to launch PuTTY at least once first).
Yes. Drill down to the individual session subkey: regedit /E "C:\path\to\one-session.reg" "HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\my-session-name".
Session names with spaces or special characters are URL-encoded in the registry path, a session named "Production Server" lives at \Sessions\Production%20Server. Use the encoded form in the command.
It MERGES, same-named sessions in the imported file overwrite the target's version of that session, but sessions that exist only on the target are kept intact. Back up the destination configuration before importing, and inspect conflicts for same-named sessions.
Same applies to the host-key cache and global preferences.
For new setups, yes for most users. The OpenSSH client is built into Windows 10 1809+ and Windows 11, uses the standard ~/.ssh/config file (plain text, version-controllable, identical to Linux/macOS), and integrates with Windows Terminal. The OpenSSH client is also the underlying ssh in WSL2.
PuTTY remains useful for: serial-line connections, telnet, Raw-mode debugging, and any workflow that depends on Pageant for SSH agent forwarding.
Sources
Authoritative references this article was fact-checked against.
- PuTTY (official site)chiark.greenend.org.uk





