Modify SSH port

Vi / etc / ssh / sshd_config,

Find port 22, then change port 22 to the port number you want,

Restart SSH service: /etc/init.d/sshd restart,

The SSH connection is then tested: SSH localhost -p Your port number is successful.

If you want insurance, you can’t connect because a port is connected (such as attack) instead of using SSH connections, then you can use multiple SSH connection ports, or modify in configuration file / etc / ssh / sshd_config, run VI /ETC / SSH / SSHD_CONFIG, find the port number place, then add a line below: Port 23, then add a new connection port, restart the SSH service, test SSH localhost -p 23, and successfully connect.In addition, it should be noted that if the unit is tested, there is no problem, but it is still not possible to use the third room tool from the external SSH link. You need to turn off the firewall and restart SSHD.OK.

Related Posts