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
After a long period of transplantation and inform...
This article example shares the simple implementa...
As shown in the figure: Table Data For such a tre...
Summary: In order to make your web page look more...
A common problem encountered during the developme...
Carousel The main idea is: In the large container...
Preface: As a giant in the IT industry, Microsoft...
(I) Method 1: Define it in advance directly in th...
Table of contents vite function Use Environment B...
Preface Only Innodb and MyISAM storage engines ca...
How to reset the initial value of the auto-increm...
Multiple values combined display Now we have th...
Table of contents Preface What are dynamic proper...
Table of contents Question: Case (1) fork before ...
Table of contents 1. Original Definition 2. JS op...