How to resolve the SU command password error when Ubuntu has just been installed.

Source: Internet
Author: User

After Ubuntu has just been installed, running the SU command in terminal will require a password, however, no matter what the loss will be wrong, the direct return is also wrong, because Root does not have a default password , need to manually set.

To install the user name entered in Ubuntu login, the user in the Admin group, has the authority to set the root password.

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

Enter the original password, the new password and the confirmation password,
[sudo] password for you:-> enter your password (you are now the user's password), do not echo
Enter new UNIX password:-> to set the root password
Retype new UNIX password:–> Repeat this
This way your root password is set.
Note:root can be omitted , command is passwd instead of password, I have made this mistake. You can switch to the root user by using the SU command in terminal.

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

2). Su directly turns the identity into root, and sudo runs the command as root after the user logs in, without needing to know the root password; in other words, all commands after the SU command are root. sudo only executes with the current statement as root.

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.