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
In the previous article - The charm of one line o...
April 23, 2020, Today, Ubuntu 20.04 on Windows al...
Prerequisites To run containers on Windows Server...
Create an HTML page with an unordered list of at l...
The machines in our LAN can access the external n...
When switching users in the docker container, it ...
Preface When making a top menu, you will be requi...
Preface Recently I found that my friend's met...
Sometimes in a project, due to some irreversible ...
Table of contents 2. Detailed explanation 2.1. Ad...
Today I had some free time to write a website for...
The Riddle vulnerability targeting MySQL versions...
This article is the second article about objects ...
Table of contents vue custom directive Global Dir...
Table of contents Project Introduction: Project D...