Linux VPS Security Settings II disable root account _linux

Source: Internet
Author: User
Tags ssh vps ssh port

After the previous "Modify SSH port" set our Linux VPS Security performance, continue to complete other methods today. Whether you want to try to invade our website is software scanning, or artificial operation of the port scan Weak command is a method, the second is to guess Root rights account. In general, we use the account login directly with root login. If we disable the root account and add an account that we know, the VPS Security Portal is basically complete. At least guessing the password thing is not done.

The first step, we first SSH landing VPS.

Useradd Laozuo #添加用户名
passwd Laozuo #为laozuo用户名设置密码

Then you need to enter the password two times, you will see as shown in the figure.

The second step is that we need to set the prohibit root user, which requires compiling the file. We can operate through the VI command, but also through the WINSCP and other FTP software to download file editing.

Vi/etc/ssh/sshd_config

Like the previous setup port, compile the Sshd_config file and change the Yes to No in the Permitrootlogin

Save exit, restart Ssh:service sshd restart (centos)/service ssh restart (Debian)

The third step is to raise the right. Log in with our newly added username and then su root to give the new user the highest privileges of the root user.

The above is the old left to share how to prohibit root permissions, there is a need for friends to refer to. It is recommended to test the machine first and then as a formal trial.

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.