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 1. Download the virtual machine...
1. Image formats supported on the WEB: GIF: can s...
Install Follow the README to install The document...
This article describes how to build a Nexus priva...
We often want to find a file in Linux, but we don...
This article example shares the specific code of ...
This article records the method of sharing files ...
Table of contents need Workaround 1. Set tooltip ...
1. Implementation ideas The purpose of interface ...
In an article a long time ago, I talked about the...
Table of contents 1. Cross-domain filter CorsFilt...
Given a div with the following background image: ...
Not using lazy loading import Vue from 'vue...
The growth path from a Linux novice to a Linux ma...
Table of contents 1. Problem Description 2. Probl...