Linux VPS Security Settings II disable the ROOT account

Source: Internet
Author: User
Tags ssh port

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.