Default Root Password setting during the first Ubuntu Installation

Source: Internet
Author: User

After Ubuntu is installed, you cannot run the su command in terminal. Because root does not have the default password, you need to set it manually.


Log On with the username entered during Ubuntu installation. the user is in the admin group and has the permission to set the password for the root user.


To set a password for the root user, follow these steps:
1. Open a terminal and enter the following command
Sudo passwd [root]


Enter the original password, new password, and confirm password,
[Sudo] password for you: ---> enter your password (your current user password) and do not echo
Enter new Unix Password: ---> set the root password
Retype new Unix Password: --> repeat this
In this way, your root password is set.
Note: root can be omitted. The command is passwd instead of password. I have made this error.

2. Use the su command in terminal to switch to the root user.

Note: The difference between Su and sudo is: 1). The su password is the root password, while the sudo password is the user password;

2 ). su directly changes the identity to root, while sudo runs the command as root after the user logs on, without the need to know the root password;

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.