1. Modify the configuration file
Modify the configuration file /etc/ssh/sshd_config file
to modify #Port 22 as follows:
Port 22
Port 50000
1
2. Restart the sshd service to
restart the sshd service, execute the following command
/etc/init.d/sshd restart
1
so the SSH port will work at 22 and 50000 at the same time.
Three, firewall configuration
edit /etc/sysconfig/iptables file
Enable port 50000.
Fourth, restart the firewall and
execute /etc/init.d/iptables restart
Note: Restart the service if you encounter: Job for ssh.service failed because the control process exited with error code reported an error, please execute "journalct -xe" to view the exception error