1. The default configuration file path is /etc/ssh/sshd_config. The red position in the figure below is the default port 22.
2. Open this file with vi/vim editor, and then modify 22 to other unoccupied ports.
3. Execute wq in vi/vim! , save and exit, and then restart the ssh service. (The picture below shows the restart of ssh service in ubuntu, and the sudo privilege is enhanced).