7

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?

4
  • Use SSH config with which software? On Linux the SSH library (which is the code that uses the config file) is shared between apps, but on Windows, you are a likely to have different SSH implementations and different configurations.
    – xenoid
    Commented Jul 1, 2020 at 13:06
  • @xenoid I'm using Powershell's Win32-Openssh: link
    – samlindev
    Commented Jul 1, 2020 at 13:12
  • 1
    And also, I'd like to use this config file, for hosts: link
    – samlindev
    Commented Jul 1, 2020 at 14:24
  • User-specific client config is the same as in Linux, within the user's home directory (Powershell: ~\.ssh\config; Explorer: %UserProfile%\.ssh\config), whereas the system-wide client ssh_config would be located at %ProgramData%\ssh\ssh_config, along with the sshd_config server config. Syntax is the same in all files, however the option parameters for file paths and subsystems is different (examples).
    – JW0914
    Commented Jul 1, 2020 at 14:46

2 Answers 2

6

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.

1
  • It worked, thank you a lot! :)
    – samlindev
    Commented Jul 1, 2020 at 16:19
3

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

3
  • Sorry, I wasn't fully specific: I want to use the one like this: link
    – samlindev
    Commented Jul 1, 2020 at 14:23
  • My linked article is for Powershell. It also says that you may use a non-default config file by setting it in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\OpenSSH.
    – harrymc
    Commented Jul 1, 2020 at 14:45
  • 1
    @harrymc OpenSSH has three default config files - user-specific (%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.
    – JW0914
    Commented Jul 1, 2020 at 14:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .