TechEarl

How to Export and Import PuTTY Sessions and Settings (Backup Guide)

Back up PuTTY sessions, host keys, and global settings from the Windows registry with a single regedit or PowerShell command. Restore on a new machine, transfer between user accounts, and troubleshoot the common Access Denied error.

Ishan Karunaratne⏱️ 11 min readUpdated
Share thisCopied
Back up PuTTY sessions and settings from the Windows registry with regedit or PowerShell. Step-by-step export, import, transfer between machines, selective export, and Access Denied troubleshooting.

PuTTY stores every session, host-key cache, and global preference in the Windows registry under HKEY_CURRENT_USER\Software\SimonTatham\PuTTY. There is still no built-in export menu (PuTTY 0.83, current as of 2026), so backup and migration are a registry-export job. The fastest method is a single regedit /E command from cmd or PowerShell — it produces a .reg file you can merge on the target machine in one double-click. Below: the exact commands (with backslashes intact, which copies of this guide elsewhere on the web tend to drop), the two scopes you'd want (everything vs sessions-only), a verification step, a PowerShell-native alternative, and the Access Denied error people hit most often.

How do I export and import PuTTY settings?

PuTTY keeps all its configuration in the Windows registry at HKEY_CURRENT_USER\Software\SimonTatham\PuTTY. To export everything (sessions, saved host keys, global preferences) to a single .reg file, run regedit /E %USERPROFILE%\Documents\putty.reg HKEY_CURRENT_USER\Software\SimonTatham\PuTTY from cmd or PowerShell. To import on another machine, double-click the resulting .reg file and confirm the merge dialog, or run regedit /S %USERPROFILE%\Documents\putty.reg for a silent merge. To export only saved sessions and skip host keys and global preferences, target the \Sessions subkey instead of the parent. The whole process takes under a minute per machine and survives Windows version upgrades, user-account migrations, and PuTTY reinstalls.

Jump to:

Where PuTTY stores its data

The full registry layout, in 2026:

Registry keyContains
HKEY_CURRENT_USER\Software\SimonTatham\PuTTYRoot of all PuTTY data for the current user
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SessionsEach saved session as a subkey (one subkey per session name)
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeysCached host keys (the "key fingerprint accepted" warnings you've previously dismissed)
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\JumplistRecent connections shown in the Windows taskbar context menu

PuTTY does not use any files in %APPDATA%, %LOCALAPPDATA%, or Program Files for configuration. Everything is in the registry. That's why a fresh PuTTY install on a different machine starts with zero saved sessions — no config to read.

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:

cmd
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 (a synonym for /EX)
  • 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 plain text (UTF-16 LE by default). You can edit it, version-control it, share it via Git.

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 cmd/PowerShell:

cmd
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. To start clean on the target, delete HKEY_CURRENT_USER\Software\SimonTatham\PuTTY first, then import.

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:

cmd
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:

cmd
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

The modern Windows-native way. PowerShell's reg.exe wrapper:

powershell
$dest = "$env:USERPROFILE\Documents\putty-full.reg"
reg export "HKCU\Software\SimonTatham\PuTTY" $dest /y

The /y flag overwrites the file without prompting. HKCU is shorthand for HKEY_CURRENT_USER.

For a sessions-only PowerShell export:

powershell
reg export "HKCU\Software\SimonTatham\PuTTY\Sessions" "$env:USERPROFILE\Documents\putty-sessions.reg" /y

The 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:

  • Be larger than ~1 KB (a single empty session is ~200 bytes; you almost certainly have more).
  • Start with Windows Registry Editor Version 5.00 on the first line.
  • Contain at least one [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\<name>] block.

Quick check from cmd:

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:

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:

  1. Sign in as User A.
  2. Export to a path readable by User B — somewhere outside User A's profile, like C:\Temp\putty.reg.
  3. Sign in as User B.
  4. 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.exe and 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. Check that you imported into the same user account you'll be running PuTTY from. The data lives in HKCU — running PuTTY as a different user (or via "Run as administrator" which switches to the Administrator profile) won't see your imports.

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. You exported the \PuTTY parent (which includes \SshHostKeys) but the target machine had different cached keys. The merge added your keys but the target's existing keys are still there. If you want a clean slate on the target, delete HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys before importing.

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.json under %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:

For backup workflows in adjacent stacks:

FAQ

Sources

Authoritative references this article was fact-checked against.

TagsPuTTYSSHWindowsRegistryBackupRemote AccessPowerShellregedit

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Tech Architect · Software Engineer · AI/DevOps

Tech architect and software engineer with 20+ years building software, Linux systems, and DevOps infrastructure, and lately working AI into the stack. Currently Chief Technology Officer at a healthcare tech startup, which is where most of these field notes come from.

Keep reading

Related posts

How to grep and Print a Specific Column (grep + awk)

grep filters lines, awk extracts fields. The classic pipe is grep 'pattern' file | awk '{print $2}'. This covers awk field basics ($1, $NF), custom separators with -F, multi-column output, the cases grep -o and cut cover on their own, and the fact that awk's own pattern match makes the grep half optional.