how to change SSH port number Step by step procedure with commands. How to change SSH port number on Linux machines. On Linux OS: ssh as root user sudo su Then run this command (use nano or vi editors) nano /etc/ssh/sshd_config file then search for "Port 22" and change the port number to the custom...