1. Add a user . First, use the adduser command to add a common user. The command is as follows:
2. Grant root permissions Method 1 : Modify the /etc/sudoers file, find the following line, and remove the comment (#) in front of it
Then modify the user to belong to the root group (wheel), the command is as follows:
The modification is complete. You can now log in with the tommy account and use the command su - to obtain root privileges to perform operations. Method 2 : Modify the /etc/sudoers file, find the following line, and add a line below root as shown below:
The modification is complete. You can now log in with the tommy account and use the command su - to obtain root privileges to perform operations. Method 3 : Modify the /etc/passwd file, find the following line, and change the user ID to 0, as shown below: tommy:x:500:500:tommy:/home/tommy:/bin/bash After modification, it is as follows tommy:x:0:500:tommy:/home/tommy:/bin/bash Save, and log in with the tommy account to directly obtain the permissions of the root account. Friendly reminder: Although method three seems simple and convenient, it is generally not recommended. Method two is recommended. How to add root permissions to a user in Linux
After the modification is completed, you can now log in with the tommy account. Then use the command su to obtain root privileges to perform operations. The above are all the relevant knowledge points introduced this time. Thank you for your learning and support for 123WORDPRESS.COM. You may also be interested in:
|
<<: Mysql online recovery of undo table space actual combat record
>>: Example of how to adapt the Vue project to the large screen
Using provide+inject combination in Vue First you...
I will be learning MySQL next semester. I didn...
Table of contents Install Basic configuration of ...
We know that there are two ways to receive incomi...
Preface When developing static pages, such as Vue...
Now that we have finished the transform course, l...
This article example shares the specific code for...
Table of contents Node connects to Mysql Install ...
How to determine whether the current Linux system...
<br />This article is mainly to let beginner...
Install and configure the MySql database system. ...
Table of contents Preface 1. Style penetration 1....
Table of contents 1.MySQL adds or subtracts a tim...
How to install Linux CentOS 7.7 system in Vmware,...
1. Four startup methods: 1.mysqld Start mysql ser...