.ssh config for Windows and Linux

October 18th, 2025 – 7:26 pm
Categorized as Computing Notes
Tagged as , ,

The ~/.ssh/config file works for OpenSSH on Windows and for SSH on Linux.

To prevent disconnects, add the keepalive messages for all hosts. For specific hosts that use a specific key type, such as RSA on CentOS 6, add the specific algorithm via the HostkeyAlgorithms + functionality. To add a private key for SSH key logins, add the IdentityFile line. it is possible to allow the ssh-rsa algorithms on both outgoing and incoming connections for all hosts. The PubkeyAcceptedAlgorithms functionality is which key can be used to log into the host the config file sits on. the ForwardX11 setting sits on Linux hosts and not on Windows..

example ~/.ssh/config

IdentityFile ~/.ssh/Minecraft-Micro.pem

Host *
    ServerAliveInterval 40

Host 192.168.0.0
    HostkeyAlgorithms +ssh-rsa
 
ForwardX11 yes
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa