I'm looking for a way to use the ssh_config
files in Windows, and I know in Linux it's located at ~/.ssh/config
.
Where is the Windows location and is there any difference in syntax or paths used inside the file?
You can create a config file at %UserProfile%\.ssh\config
. I don't have a source for this, but it works for SSH connections in PowerShell and remote connections within Visual Studio Code.
I don't think OpenSSH config in Windows 10 differs from Linux in terms of syntax; I've copied and pasted configs from Windows 10 to WSL and to native Linux machines with no issues.
According to OpenSSH Server Configuration for Windows 10 1809 and Server 2019:
In Windows, sshd reads configuration data from
%programdata%\ssh\sshd_config
by default
HKEY_LOCAL_MACHINE\SOFTWARE\OpenSSH
.
%UserProfile%\.ssh\config
) and system-wide (%ProgramData%\ssh\ssh_config
) client configs and a system-wide (%ProgramData%\ssh\sshd_config
) server config; the same is true for BSD/Linux, just at different locations (~/.ssh/config
, /etc/ssh/ssh_config
, and /etc/ssh/sshd_config
). If the user-specific client config is present, it supersedes the system-wide client config.
~\.ssh\config
; Explorer:%UserProfile%\.ssh\config
), whereas the system-wide clientssh_config
would be located at%ProgramData%\ssh\ssh_config
, along with thesshd_config
server config. Syntax is the same in all files, however the option parameters for file paths and subsystems is different (examples).