Ubuntu 13.10 on how users get root permissions, how users get permanent root permissions, if you configure the root login
Source: Internet
Author: User
Ubuntu 13.10 on how users get root privileges, how users get permanent root privileges, if you configure root login
First, how the user obtains root authority:
1. Enter Terminal
2. Enter sudo passwd root and set the password, prompting you to enter the password two times, set your own password, be sure to remember, and then switch to root to use
3. Enter Su root, ask you to enter the password, and then enter the password you just set it in.
4. If you do not want to switch root but want to have most root privileges, you can add sudo when using the command.
sudo mount Mount
sudo command
......
Another
If you want to switch users on Linux, then enter SU + username is ok, he will ask you to enter the password
Ii. How to obtain permanent root privileges for users
1. Add a user, first add a normal user with the AddUser command, the command is as follows: #adduser Tommy//Add a user named Tommy
#passwd Tommy//Change Password
Changing password for user Tommy.
New UNIX Password://Enter your password here
Retype new UNIX Password://Enter password again
Passwd:all authentication tokens updated successfully.
2. Give root privileges
Method One: Modify the/etc/sudoers file, locate the following line, remove the previous comment (#)
# # allows people in group wheel to run all commands
%wheel all= (All) all
Then modify the user to belong to the root group (wheel) with the following command:
#usermod-G root Tommy
After the modification, you can now log in with your Tommy account, and then use the command Su-to get root privileges to operate.
Method Two: Modify the/etc/sudoers file, locate the following line, and add a line under root as follows:
# allow ROOT to run any commands anywhere
Root all= (All) all
Tommy All= (All) all
After the modification, you can now log in with your Tommy account, and then use the command Su-to get root privileges to operate.
Method Three: Modify the/etc/passwd file, locate the following line, change the user ID to 0, as follows:
Tommy:x:500:500:tommy:/home/tommy:/bin/bash modified as follows Tommy:x:0:500:tommy:/home/tommy:/bin/bash
Save, with Tommy account login, directly get the root account permissions.
Friendly reminder: Although method three looks simple and convenient, but generally not recommended use, recommended method two.
Third, configure the root login
Ubuntu 13.10 Default is not allowed to use root login, if you want to use root permissions, you must use the sudo command to execute, very cumbersome.
To solve this problem, you need two steps:
1. Set the root password to open the root account
Ubuntu default root password is said to be automatically changed every 5min, so you first need to change the root password, set to a fixed value:
$sudo passwd Root
Follow the prompts two times to enter a new password, this time you can use root login;
Login mode: $su or su root or sudo-s
Then follow the prompts to enter the password can be in the terminal with root login;
2. Modify the LIGHTDM configuration
Open root Login, modify/etc/lightdm/lightdm.conf.d/10-ubuntu.conf file
(seemingly modified 50-unity-greeter.conf or several other configuration files are OK, have not tried, interested can try.) )
Vim/etc/lightdm/lightdm.conf.d/10-ubuntu.conf
Added: Greeter-show-manual-login=true
Allow-guest=true
ubuntu10.04 version is to modify the/etc/lightdm/lightdm.conf file
Description: Greeter-show-manual-login=true #允许手工输入登陆系统的用户名和密码
Allow-guest=true #允许guest登录, can be modified according to their own needs
After saving the reboot, you can log in by entering the user name root
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.