Following the previous article "Modify SSH port" to set the security performance of Linux VPS, we will continue to complete other methods today. Whether it is to try to intrude into our website is software scanning, or manual port scanning weak commands is a way, followed by guessing the ROOT account. Generally, we use ROOT to log on directly with an account. If we disable the ROOT account and add an account we know, the VPS security portal is basically complete. At least the password cannot be guessed.
Step 1: log on to VPS through SSH.
Useradd laozuo # Add User Name
Passwd laozuo # set a password for the laozuo User Name
Enter the password twice and you will see it.
Step 2: we need to set to prohibit the ROOT user, which requires file compilation. We can use VI commands or FTP software such as WINSCP to download and edit files.
Vi/etc/ssh/sshd_config
Compile the sshd_config file, and change YES in PermitRootLogin to NO.
Save and exit, restart SSH: service sshd restart (centos)/service ssh restart (debian)
Step 3: Raise the permission. Log in with the new user name, and thenSu rootTo grant new users the highest permissions of the ROOT user.
The above shows how to deny ROOT permissions shared by the old left. If you have any need, refer. We recommend that you first test the machine and then try it out.