sodcalculator

10 Tech How-To

Fix SSH DLL Errors on Windows: Step-by-Step Guide

Guide 10-37398 · Updated · Step by step

SSH DLL errors on Windows typically appear when the OpenSSH client or server can’t load a required dynamic link library, often after a Windows update, a partial uninstall, or a corrupted system file. This guide walks you through the safe, standard fixes that resolve most of these errors without reinstalling the whole OS.

What You’ll Need

  • Administrator access to the Windows machine
  • An internet connection (to download updates or the OpenSSH optional feature)
  • About 15–30 minutes of time

Step-by-Step

  1. Identify the exact error message. When the error appears, note the name of the missing DLL (e.g., libcrypto.dll, ssh.dll, zlib.dll). This tells you whether the problem is with the SSH client itself or a dependency. Write it down.
  2. Run the System File Checker. Open Command Prompt as Administrator (press Win, type cmd, right-click it, and choose “Run as administrator”). Type sfc /scannow and press Enter. Let it finish; it checks and repairs protected system files, including many DLLs. Restart if it reports repairs.
  3. Run DISM to repair the system image. In the same elevated Command Prompt, run DISM /Online /Cleanup-Image /RestoreHealth. This fixes corruption in the Windows image that SFC can’t. It may take 10–20 minutes. Restart afterward.
  4. Repair or reinstall the OpenSSH feature. Go to Settings → Apps → Optional Features. Find “OpenSSH Client” (and “OpenSSH Server” if you use it). Click it and choose Uninstall. Then click Add a feature, search for OpenSSH, and reinstall it. This replaces all SSH-related DLLs with fresh copies.
  5. Check for Windows updates. Go to Settings → Windows Update and click Check for updates. Install all pending updates, especially security and quality updates. A known bug in an older build often causes DLL load failures; updating resolves it.
  6. Verify the PATH environment variable. Open System Properties → Environment Variables. Under “System variables,” select Path and click Edit. Ensure C:\Windows\System32\OpenSSH is listed. If not, add it. Click OK on all dialogs and restart your terminal.
  7. Test with a clean command prompt. Open a new Command Prompt (not PowerShell) and run ssh -V. If it prints a version number, the client DLLs are loading correctly. If you still get the DLL error, note the exact DLL name for the next step.
  8. Manually replace a specific DLL (advanced). If the error names a DLL that belongs to OpenSSH (like ssh.dll), copy it from a working Windows machine of the same version, or extract it from the OpenSSH Win64 zip from the official PowerShell team’s GitHub releases. Place it in C:\Windows\System32\OpenSSH and restart.

Common Mistakes

  • Downloading DLLs from random websites. These are often infected or mismatched. Always use official Windows sources or the OpenSSH GitHub release.
  • Running SFC without administrator rights. It will fail or do nothing. Always right-click and run as administrator.
  • Skipping the restart after SFC or DISM. Repairs often only take effect after a reboot.
  • Editing the PATH incorrectly. Deleting other entries can break other programs. Only add the OpenSSH path, don’t remove existing ones.
  • Assuming it’s a virus. While malware can cause DLL errors, most SSH DLL errors are due to missing updates or corrupted system files. Run a full antivirus scan only after the above steps fail.

Tips

  • Keep Windows Update set to automatic. Most SSH DLL errors are fixed silently by monthly cumulative updates.
  • If you use a third-party SSH client (like PuTTY), its DLLs are separate. Uninstall and reinstall that software instead of touching the Windows OpenSSH folder.
  • Use where ssh in Command Prompt to see which copy of ssh.exe Windows is using. If it points to a non-standard location, that could be the source of the DLL mismatch.
  • Create a system restore point before making manual changes. This lets you roll back if something goes wrong.

Troubleshooting

If the steps above don’t fix the error, work through these in order:

  • Error still names a specific DLL after reinstalling OpenSSH. The DLL may be missing from the system folder. Check if the file exists in C:\Windows\System32\OpenSSH. If it’s there, try copying it to C:\Windows\System32 as well.
  • Error appears only in PowerShell but not Command Prompt. PowerShell may be loading a different SSH module. Run Get-Module -ListAvailable OpenSSHUtils and update or remove that module.
  • Error appears after a recent Windows feature update. Roll back the update via Settings → Windows Update → Update history → Uninstall updates, then reinstall it after checking for a newer cumulative update.
  • DLL error mentions libcrypto or libssl. These are OpenSSL libraries. Install the latest OpenSSL binary from a trusted source (like the official OpenSSL wiki) and add its bin folder to your PATH.
  • All steps fail and the error persists. Use the Windows Media Creation Tool to perform an in-place upgrade repair. This reinstalls Windows while keeping your files and apps. It’s the last non-destructive option.

Frequently Asked Questions

Q: What causes SSH DLL errors on Windows?
A: Most often a Windows update that partially replaced OpenSSH files, a corrupted system image, or a third-party program that overwrote a shared DLL. Rarely, it’s malware.

Q: Can I fix this without admin rights?
A: No. SFC, DISM, and reinstalling the OpenSSH feature all require administrator privileges. If you don’t have them, ask your IT department.

Q: Will reinstalling OpenSSH delete my SSH keys and config?
A: No. Your keys in C:\Users\YourName\.ssh and the config file there are untouched by the feature reinstall. Only the program files are replaced.

Q: Is it safe to download the missing DLL from a DLL site?
A: No. Those sites are notorious for hosting malicious or mismatched files. Always use the official OpenSSH GitHub release or the Windows feature installer.

Q: Why does the error disappear after I restart my PC?
A: A temporary file lock or a pending update can cause a one-time DLL load failure. If it comes back consistently, follow the steps above; if it’s truly random, it’s likely a flaky antivirus or disk issue.

Q: Does this affect SSH connections to remote servers?
A: Yes. If the client DLLs fail to load, you can’t initiate SSH connections. The server side has separate DLLs; if you only use the client, focus on the client fixes.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →