Change default port of OpenSSH client for Windows

If you are using the ‘native’ OpenSSH agent for Windows 10 and above then you might want to connect to hosts that are using a non-standard SSH port. Specifying the port each time is easy enough using the -p switch (e.g. ssh user@host -p 2222) but you may want that port to be the default for your client. If so then simply create an ssh_config file under C:\ProgramData\ssh\
Then add the following to the file, save and enjoy.

Bash
Port 2222

Leave a Reply

Your email address will not be published. Required fields are marked *