Ubuntu Set Root User Login

Source: Internet
Author: User

Since Ubuntu is a Debian-based Linux operating system, in the default case, there is no Superuser (superuser, root), but some system operations must have superuser privileges to do so, such as manually freeing memory.

Under other Linux operating systems, such as fedora, you can use SU to switch to Superuser.

When you enter the SU command, you will be asked to enter the root password.

However, under Ubuntu we have no idea what root password is.

This way, there are two main ways to switch to super users under Ubuntu:

1) Sudo-i

Sudo is a reinforced version of Su, meaning do something as the supervisor.

You do not need a password to get root privileges.

But it also has a lot of limitations, for example, in the default case, you can only use root permissions in 5 minutes.

2) If you want to use root permissions all the time, whether you want to use Su, or you want to get the root password.

Use sudo passwd root to set the root password.

After that, you are free to use the SU command.
--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------

Summarize:

  

Ubuntu two ways to set root permissions

Way One

Sudo-i is a temporary root privilege (note that if your Ubuntu system does not have a root user, you will be prompted for a password after entering sudo-i to enter the password for the currently logged in user)

Mode two (mode two is not only to set the root command and also to update the root password command)

sudo passwd root will prompt for a password after the terminal is entered as a permanent method.

You can then log in to the terminal input Su

  

The root password I set above is root, so I type root and enter.

  

Ok

If our root password is forgotten, you can also use the sudo passwd root command above to reset the password.

Ubuntu Set Root User Login

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.