Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to log in to ubuntu sudo and root

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to log in to ubuntu sudo and root. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

Ubuntu Linux has a distinctive feature, that is, when you use it for the first time, you can't log in to the system as root. Why? This should start with the installation of the system. For other Linux systems, it is common to set the root password during installation so that users can use it to log in to their root account or use the su command to switch to superuser status. In contrast, Ubuntu is installed by default with no password set for root users and no root account enabled. The question is, what do you do if you want to run commands as a root user? It doesn't matter, we can use the sudo command to do this.

Sudo is a commonly used tool under linux to allow ordinary users to use superuser privileges. This command provides a fine-grained access control method for administrators, through which people can access the system as both superusers and other types of users. The advantage of this is that administrators can grant users certain types of superuser privileges without telling them their root password, which is what many system administrators dream of.

Setting up the assignment is simple, as long as you set a root password for root: $sudo passwd root

After that, you will be prompted to enter the password of the root user, enter the root password in succession, and then use: $su

You can switch to Super Admin user login!

1. After the terminal executes the sudo passwd root command, you will be prompted to set a new root account password.

two。 Click the System-> Preferences-> Login Window menu, switch to the Security options page, and select the "Allow local system administrator login" option under it.

After performing the above two steps, you can log in to the Ubuntu system using your root account.

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

Sudo passwd root sets the password of the root user to open the root account, locking the account is sudo passwd-l, and opening the account is sudo passwd-u (it needs to be locked before, otherwise it is invalid).

Method 2:

Log in with your root account in Ubuntu

In fact, I personally do not think this is necessary, because when you need the authority of root, you can use sudo. If you really need to enable your root account in Ubuntu, do the following:

1. Reset the password for root:

$sudo passwd root # enter the new password twice as prompted and confirm it.

two。 Enable root user login:

$sudo vi / etc/gdm/gdm.conf #

Open the configuration file of gnome, type: AllowRoot enter in the last line mode, find AllowRoot=false, change false to true, save and exit.

After that, when you restart the system, you can log in with root. If you want to disable the root account, execute the following command:

$sudo passwd-l root

The root account in Ubuntu is disabled by default. In this case, if you want to use root permissions to do something, you need the sudo instruction. For some friends, they may need to activate their root account in Ubuntu.

How to make root log in to the system collection on Fedora 10

By default, Fedora10 does not allow root accounts to log in to GUI. Here is the solution.

First, enter the terminal with the user account and allow the root account to log in:

First of all, su

Then vi / etc/pam.d/gdm

Delete the line auth required pam_succeed_if.so user! = root quiet

Then wq saves and exits.

This allows you to log in to GUI using root.

You can also modify the / etc/gdm/contom.conf file by adding the following lines to enable root automatic login

[daemon]

AutomaticLoginEnable=true

AutomaticLogin=user_name

The network service of Fedora 10 cannot be started automatically and also needs to be modified.

Chkconfig-level 35 network on

If you use the GUI interface to modify the network configuration, it seems that the modification program has BUG. After the subnet mask is changed, it becomes 192.168.1.1.

Similarly, you can modify it directly in the file.

File location: / etc/sysconfig/network-scripts/ifcfg-eth0

You can also:

Boot to root login system, login mode is a graphical interface, prompt can not verify the user, very puzzled, the password is also correct ah, enter several times still prompt "unable to verify the user". I have to log in with an ordinary user.

Open the terminal and enter su, and then enter the root password to successfully transfer to the root user. Set boot mode to text mode, restart to text mode, enter root and password, login is successful, it seems that you can log in with root in text mode.

Cannot log in to graphics mode as root, probably for security reasons. Although you can only log in to the graphical interface with ordinary users, the password of root can be changed in graphical interface mode. Select system-> Administration-> Root password and pop up the dialog box for changing the root password.

twenty-eight。 Graphical root login

Fedora 11 does not allow login as root in GDM by default, but must use normal users to log in to become root permissions in the terminal. Then many users still want to log in as root. Although I don't approve, I'd like to tell you how to do it. Please don't forget that once you log in using root, it will destroy your system, so please do not enter the following command unless you know what you are doing.

Open the terminal to enter:

Su-c 'gedit / etc/pam.d/gdm'

Find the following line:

Auth required pam_succeed_if.so user! = root quiet

Make a note of this line:

# auth required pam_succeed_if.so user! = root quiet

Save this file and log out, and then you can log in as root.

Author: dhq release date: 2009-6-11

This post was last edited by dhq at 19:31 on 2009-6-11.

Modify this file in 11:

/ etc/pam.d/gdm-password

After reading the above, do you have any further understanding of how to log in to ubuntu sudo and root? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report