Programdata ssh folder? What It Is & How to Use It
In this article
The ProgramData\ssh folder is the default location where the OpenSSH Server on Windows stores its configuration files, host keys, and logs. If you have installed the OpenSSH Server feature on Windows 10 or 11, you will find sshd_config, host keys, and the logs subfolder inside C:\ProgramData\ssh. This article explains what each file does, how to edit them safely, and how to troubleshoot common issues.
Background: Why Windows Uses ProgramData\ssh
Unlike Linux, where OpenSSH configuration lives in /etc/ssh, Windows places these files in ProgramData because that directory is shared by all users and is accessible to services running under the SYSTEM account. The ProgramData folder is hidden by default, so many users never see it until they need to change a setting.
When you enable the OpenSSH Server feature via Settings or PowerShell, Windows creates the C:\ProgramData\ssh directory automatically. The folder is not created if you only install the client (OpenSSH Client), because the client does not need a configuration file by default.
Key Files Inside ProgramData\ssh
Here is what you will typically find:
- sshd_config – the main configuration file for the SSH server. It controls port, authentication methods, and allowed users.
- ssh_host_ed25519_key and ssh_host_rsa_key – private host keys used to identify the server. The corresponding
.pubfiles are the public keys. - logs – a subfolder that contains debug logs when you enable logging in
sshd_config. - administrators_authorized_keys – a special file that holds public keys for administrators. This file is not present by default; you must create it manually.
How to Access and Edit the Folder
Because the folder is hidden, you can navigate to it in File Explorer by typing C:\ProgramData\ssh in the address bar. To edit sshd_config, you need administrator privileges:
- Open Notepad as Administrator (right-click Notepad, choose “Run as administrator”).
- Go to File > Open, then paste
C:\ProgramData\ssh\sshd_configinto the file name box. - Make your changes and save.
If you try to open the file without admin rights, Windows will block the save. Also, the file may be read-only for normal users, so the admin step is essential.
Common Configuration Changes
Most users open this folder to change the SSH port or enable key-based authentication. For example, to change the default port from 22 to 2222, find the line #Port 22, remove the #, and change the number. After editing, restart the service by running Restart-Service sshd in an elevated PowerShell.
Another frequent change is to allow password authentication. The default is PasswordAuthentication yes, but some builds set it to no. If you cannot log in with a password, check this line.
Permissions and Security: The administrators_authorized_keys File
One of the most confusing aspects is that the default sshd_config on Windows does not use ~/.ssh/authorized_keys for administrators. Instead, it looks for C:\ProgramData\ssh\administrators_authorized_keys. This file must have strict permissions: only Administrators and SYSTEM should have access. If the permissions are too loose, the SSH server will ignore the file and you will not be able to log in with a key.
To create this file correctly, open an elevated PowerShell and run:
New-Item C:\ProgramData\ssh\administrators_authorized_keys -ItemType FileThen set permissions with:
icacls C:\ProgramData\ssh\administrators_authorized_keys /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"If you copy a public key into this file, ensure there are no extra spaces or line breaks.
Common Problems and Fixes
Here are three typical issues and their solutions:
- “sshd_config” missing – If you installed OpenSSH Server but the folder is empty, run
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*'to confirm it is installed. If it is, restart thesshdservice; the files are generated on first start. - Permission denied when saving – You are not running the editor as administrator. Close and reopen Notepad with “Run as administrator”.
- Host key not found – If you see “Host key verification failed” on the client, delete the old host key from the client’s
known_hostsfile, or regenerate the server keys by deleting thessh_host_*files and restarting the service.
Comparison: ProgramData\ssh vs. ~/.ssh
On Windows, there are two distinct SSH folders. C:\ProgramData\ssh is for the server (sshd). The client (ssh.exe) uses C:\Users\ for your personal keys and known_hosts. Mixing them up is a common mistake: if you put your public key in ProgramData\ssh but the server is configured to look at administrators_authorized_keys, it will not work. For non-admin users, the server looks at C:\Users\ – but only if you uncomment the AuthorizedKeysFile line in sshd_config.
Frequently Asked Questions
Can I delete the ProgramData\ssh folder?
No, if you have OpenSSH Server installed, deleting it will break the service. The server will fail to start because it cannot find its configuration and host keys. If you want to remove SSH entirely, uninstall the OpenSSH Server feature from Windows Features or PowerShell.
Why is the folder hidden?
Windows hides ProgramData by default to prevent accidental modification. You can unhide it by going to File Explorer > View > Options > View and selecting “Show hidden files, folders, and drives”. However, it is safer to leave it hidden and access it via the address bar.
How do I change the SSH port in ProgramData\ssh?
Edit sshd_config as administrator, find the line #Port 22, remove the #, change the number, then restart the sshd service. Remember to open the new port in Windows Firewall.
What is the default password for the ssh folder?
There is no password. The folder is protected by Windows file permissions, not a password. You need administrator rights to modify files inside it.
Why does my SSH server ignore my authorized_keys file?
For administrators, the server uses administrators_authorized_keys in ProgramData\ssh, not ~/.ssh/authorized_keys. Also, check the file permissions – they must be restricted to Administrators and SYSTEM. For regular users, make sure the AuthorizedKeysFile line in sshd_config is not commented out.