The modification is the/etc/ssh/sshd_config file. (The first modification is the ssh_config file. The result is that the SSH service is restarted. Why didn't it take effect? I still wondered. Then I ran in Google and the answer came out.
[Root @ Linux ~] # Vi/etc/ssh/sshd_config
# $ OpenBSD: sshd_config, V 1.69 2004/05/23 23:59:53 dtucker exp $
# This is the sshd server system-wide configuration file. See
# Sshd_config (5) for more information.
# This sshd was compiled with Path =/usr/local/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped
# OpenSSH is to specify options with their default value where
# Possible, but leave them commented. uncommented options change
# Default value.
Port 2222 // In the past, there was a number # in front of it, and the default value is 22. It will be OK after modification.
# Protocol 2, 1
# Listenaddress 0.0.0.0
# Listenaddress ::
# Hostkey for Protocol Version 1
# Hostkey/etc/ssh/ssh_host_key
# Hostkeys for Protocol Version 2
# Hostkey/etc/ssh/ssh_host_rsa_key
# Hostkey/etc/ssh/ssh_host_dsa_key
4. Restart the SSH service. The modified port takes effect.
[Root @ Linux ~] # Service sshd restart
Stopping sshd: [OK]
Starting sshd: [OK]
[Root @ Linux ~] #
5. Run the netstat-An command to check whether it is correct.