This host maintenance note, published on November 3, 2017, is titled "How to Change the SSH Port on a Linux Server in CentOS 7". The actual environment and tools involved include Linux.
Domain and site configuration
The default root port for most Linux VPS/servers is 22. Theoretically, in practice, port 22 should be changed to another port to ensure a certain level of security. If you can log in, edit the configuration file and remove or delete the line containing port 22. After editing, you will definitely need to restart the SSH service for the changes to take effect.
Data center and resources
If the data is important, you can back it up or take a snapshot to ensure its safe storage before changing the port.
Parameters recorded in the original text
- Version history:CentOS7, centOS6, centOS7
Matters mentioned in the article
- First, prepare safety instructions.
- Second, the steps to change the SSH port.
- 2. If the data is important, back it up or take a snapshot to ensure its safe storage before changing the port.
- 3. Check if SELinux is disabled.
- 1. Modify the /etc/ssh/sshd_config configuration file
- 3. Check if the port is open.
- 4. Restart the SSH service
Usage Environment
Linux.
Key points to check
Migration checksSimultaneously back up website files and the database. After migration, verify the homepage, backend login, form submissions, and static resources, and finally switch DNS settings.
Data verificationWhen databases are involved, the version, character set, and number of tables should be recorded, and it should be verified that the backup can be restored in an independent environment.