1. Log in to the server and open the Sshd_config file
# Vim/etc/ssh/sshd_config
2, find #port 22, the default is commented out, the first # to remove, and then insert a line to set the port number you want, be careful not to repeat with the existing port number
# The strategy used for options on the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. uncommented Options Change A
# default value.
Port 22
Port 26580
3. Exit after saving, execute restart command
#/etc/init.d/sshd Restart
4, a new terminal window test 23456 whether the port can be properly connected to the server, if successful, the port 22 is deleted, the reason is set to two ports, test success and then close a port, is in order to modify the Conf process, in the event of a drop line, broken network, misoperation, such as unknown circumstances, can also be connected through another port to debug to avoid the connection does not have to send people to the computer room, causing problems more complicated trouble.
Linux Server modify SSH default 22 port method