ps: Here is how to disable remote login of root account in Linux system. The details are as follows: Modify the configuration file /etc/ssh/sshd_config, remove the comment before PermitRootLogin, change the value to no, and then restart the sshd service. #LoginGraceTime 2m PermitRootLogin no #StrictModes yes MaxAuthTries 3 #MaxSessions 10 service sshd restart After performing this operation, the root account will not be able to log in remotely, so you must create a new account and set a password before doing this.
ps: Let's take a look at disabling root remote login and adding new users under Linux 1. Add a user with the same permissions as root 1. adduser admin passwd admin (change password) Then enter the password (a simple password will not work) The system prompts you to enter a confirmation password and then enter it again. OK Added successfully. 2. Modify the /etc/sudoers file, find the following line, and add a line below root as follows: vim /etc/sudoers ## Allow root to run any commands anywhere root ALL=(ALL) ALL admin ALL=(ALL) ALL This file is read-only as a protection mechanism. If you use the vi editor, just use :wq! to save it. Or use the visudo command to enter the sudoers file editor and save it normally 1) Single-line copy In command mode, move the cursor to the line to be copied and press "yy" to copy; 2. Disable root remote login You need to edit /etc/ssh/sshd_config. vim /etc/ssh/sshd_config find PermitRootLogin Change to PermitRootLogin no Restart service sshd restart Conclusion: This will prohibit the root user from logging in and log in with admin. It's so complicated for safety. You only banned the root user from logging in, not other users. Log in with another user first, then switch back to the root user with su root Switch to the root user and enter the password Summarize The above is the command that I introduced to you to prohibit remote login of the root account in the Linux system. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time! You may also be interested in:
|
<<: MySQL 8.0.11 Community Green Edition Installation Steps Diagram for Windows
>>: Django+vue registration and login sample code
Table of contents use Use of EsLint Add a profile...
1. MyISAM storage engine shortcoming: No support ...
Table of contents 1. Download 2. Deployment 1.Ngi...
This article shares the specific code of javascri...
1. Environmental requirements 1. Docker 17 and ab...
You can often see articles about CSS drawing, suc...
Table of contents Preface How does antd encapsula...
The docker create command can create a container ...
introduction In this article, we will introduce h...
I have recently been following the CSS Animation ...
After three days of encountering various difficul...
Have you ever had the need to compute a very larg...
Table of contents 1. Computed properties Syntax: ...
This article shares the specific code of JavaScri...
Types of joins 1. Inner join: The fields in the t...