How do users obtain root privileges on Ubuntu 13.10, how do users obtain permanent root privileges, and how to configure root login

1. How do users get root privileges:
1. Enter terminal
2. Enter sudo passwd root and set a password, you will be prompted to enter the password twice, set the password yourself, be sure to remember, and then switch to root to use
3. Enter su root , You are required to enter the password, then enter the password you just set and press Enter to enter.
4. If you don’t want to switch root but want to have most of the root privileges, you can add sudo when using the command,
sudo mount mounts
the sudo command
... ...
another
If you want to switch users on linux, then enter su + username and it will be OK, he will ask you to enter a password

2. How do users get permanent root privileges
1. To add users, first add an ordinary user with the adduser command , the command is as follows: #adduser tommy //add a user named tommy
#passwd tommy //change the password
Changing password for user tommy.
New UNIX password: //enter the new password here
Retype new UNIX password: //enter the new password again Password
passwd: all authentication tokens updated successfully.
2. Grant root permission
Method 1: Modify the /etc/sudoers file, find the following line, and remove the previous comment (#)
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
Then modify the user so that it belongs to the root group (wheel), the command is as follows:
#usermod -g root tommy
After modification, you can now log in with the tommy account , and then use the command su - to obtain the root authority to operate.
Method 2: Modify the /etc/sudoers file, find the following line, and add a line under root, as shown below:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
tommy ALL=(ALL) ALL
is modified, Now you can log in with the tommy account, and then use the command su - to obtain root authority for 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 is modified as follows tommy:x :0:500:tommy:/home/tommy:/bin/bash
Save, after logging in with the tommy account, you will directly obtain the permissions of the root account.
Friendly reminder: Although method 3 seems simple and convenient, it is generally not recommended, and method 2 is recommended.

3. Configure root login
Ubuntu 13.10 does not allow root login by default. If you want to use root privileges, you must use the sudo command to execute, which is very cumbersome.
To solve this problem, two steps are required:
1. Set the root password and open the root account. The
default root password of ubuntu is said to be automatically changed every 5 minutes, so first you need to modify the root password and set it to a fixed value:
$ sudo passwd root
Enter the new password twice according to the prompt, and you can log in as root at this time;
login method: $su or su root or sudo -s
and then enter the password according to the prompt to log in as root in the terminal;
2. Modify the lightdm configuration
to open Log in as root, modify the /etc/lightdm/lightdm.conf.d/10-ubuntu.conf file
(it seems that modifying 50-unity-greeter.conf or several other configuration files is also ok, I have not tried it, if you are interested, you can try it .)
Vim /etc/lightdm/lightdm.conf.d/10-ubuntu.conf
added: greeter-show-manual-login=true
allow-guest=true
ubuntu10.04 version is to modify /etc/lightdm/lightdm.conf File
description: greeter-show-manual-login=true #Allow manual input of user name and password to log in to the system
allow-guest=true #Allow guest to log in, you can modify and
save according to your own needs and restart, you can log in by entering the user name root up

Guess you like

Origin blog.csdn.net/Vincent20111024/article/details/24981163