1. Modify the s h Port
The default s h port of VPS is 22. To prevent MJJ from scanning the port to crack the password, it is necessary to change the ssh port to another number.
Now, log on to the VPS through SSH and modify the configuration file.
Vi/etc/ssh/sshd_config
Find # Port 22, remove the previous #, and change it to Port 1520 (the number should be 4 digits as much as possible to avoid being occupied), and then restart it to take effect.
CentOS restart SSH: service sshd restart
Debian restart SSH: service ssh restart
2. Prohibit ROOT account login
If we disable the ROOT account and add an account we know, we cannot at least guess the password.
First, add the user name.
Useradd zxsdw
Set password for new user name
Passwd zxsdw
Second, prohibit root login
Vi/etc/ssh/sshd_config
Locate PermitRootLogin yes, remove the previous #, change yes to no, save and restart ssh.
Finally, log on to the newly added user.
Log in and use the su root command to escalate permissions so that new users have ROOT management permissions.
Example:
Login as: zxsdw # New User name
Password: ***** # New user password
Su root # Elevation of Privilege
Password: ***** # Original ROOT Password