Linux-Ubuntu enables the root account

Source: Internet
Author: User

From: http://zengxx1989.iteye.com/blog/477619

Ubuntu Linux has a distinctive feature, that is, when you use it for the first time, you cannot log on to the system as the root user. Why? This should begin with the installation of the system. For other Linux systems, the root password is usually set during the installation process, so that the user can use it to log on to the root account or use the su command to convert to the Super User identity. In contrast, UBUNTU does not set a password for the root user or enable the root account when it is installed by default. The problem is, what should I do if I want to run the command as a root user? It doesn't matter. We can use the sudo command for this purpose.
Sudo is a common tool in Linux that allows common users to use superuser permissions. This command provides the Administrator with a fine-grained access control method, through it, people can access the system both as Super Users and as other types of users. The advantage of this is that administrators can grant some specific types of Super User Permissions without telling the user the root password. This is exactly what many system administrators dream.

Method 1:
It's easy to set the allocation. Just set a root password for the root user: $ sudo passwd Root
You will be prompted to enter the root user password, enter the root password continuously, and then use: $ su
You can switch to the super administrator user to log on!

1. After executing the sudo passwd root command on the terminal, the system will prompt you to set a new root account password.
2. Click system-> preferences-> login window menu, switch to the security option page, and select the "Allow local system administrator login" option. After performing the preceding two steps, you can use the root account to log on to the Ubuntu system.

If you want to disable the root account again, run sudo passwd-l root.

Sudo passwd root is used to set the password of the root user to enable the root account. The account to be locked is sudo passwd-l, and the account to be opened is sudo passwd-U (it must be locked before, otherwise it is invalid ).

Method 2:
Use the root account to log on to Ubuntu
In fact, I personally think this is not necessary, because when you need the root permission, you can use sudo. If you need to enable the root account in Ubuntu, perform the following operations:
1. Reset the root password: $ sudo passwd Root
# Enter the new password twice as prompted and confirm the password.
2. Enable Root User Logon: $ sudo VI/etc/TPD. conf
# Open the gnome configuration file, input: allowroot press enter in the last line mode, find allowroot = false, change false to true, save the file, and exit.
After that, you can log on to the system as the root user. If you want to disable the root account, run the following command: $ sudo passwd-l Root
The root account in Ubuntu is disabled by default. In this case, if you want to use the root permission to do something, you need the sudo command. For some friends, they may need to activate the root account in Ubuntu.

 

How to log on to the system as root on fedora 10

By default, fedora10 does not allow the root account to log on to the GUI. The solution is as follows.
First, enter the terminal with the user account, and allow the root account to log on:
First, Su
Then VI/etc/PAM. d/TPD
Delete the line auth required pam_succeed_if.so user! = Root quiet
Then WQ is saved and exited.
In this way, you can use root for GUI login.
You can also modify the/etc/TPD/contom. conf file, add the following lines, and enable automatic root login.
[Daemon]
Automaticloginenable = true
Automaticlogin = user_name

The Network Service of Fedora 10 cannot be started automatically and needs to be modified.
Chkconfig -- level 35 network on
If you use the GUI to modify the network configuration, it seems that the modification Program If there is a bug, the subnet mask is changed and then turned on to 192.168.1.1.
Similarly, you can directly modify it in the file. File Location:/etc/sysconfig/network-scripts/ifcfg-eth0
You can also log on to the system as the root user at startup. The logon mode is a graphical interface, prompting that the user cannot be verified. The password is correct. after entering the password several times, the system still prompts "the user cannot be verified ". I had to log in with a common user. Open the terminal, enter the Su, and then enter the root password. The password is successfully transferred to the root user. Set the start mode to text mode, restart to text mode, enter the root and password, and log on successfully. It seems that the root user can log on to the system in text mode.
You cannot log on to the graphic mode as root, probably for security reasons. Although only common users can log on to the GUI, you can change the root password in Gui mode. Choose system> Manage> root password. The change Root Password dialog box is displayed.

Graphical Root Login
By default, fedora 11 does not allow you to log on as a root user in the Management Terminal (running as a root user) rather than using the root user to log on to the Management Terminal. Then many users still want to log on as root. Although I do not agree, I 'd like to explain how to do it. Please do not forget that your system will be destroyed once you log on with root, so please do not enter the following command unless you know what you are doing.
Open the terminal and enter Su-C 'gedit/etc/PAM. d/TPD.
Find the following line: auth required pam_succeed_if.so user! = Root quiet
Leave this line of remarks: # auth required pam_succeed_if.so user! = Root quiet
Save the file and log out. Then you can log in as root.

[Thanks to the author]
Http://hi.baidu.com/%BA% AE %D0%C7_xu/blog/item/8194087077cf9d0a8701b0cb.html

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.