Switching users of Linux commands

Source: Internet
Author: User

One, switch from user to root user

Whether you're logging in to Ubuntu in graphical mode or in command-line mode, we'll find that the default is user, but when we need to do something with root privileges (such as a system file), we often need to use sudo to authorize it, which is a hassle, and we can switch to the root user, Simply execute sudo su.

1 [email protected]:~$ sudo su2

Note: For security reasons, the default Ubuntu root user does not have a fixed password, its password is randomly generated and dynamically changed, it seems to change every 5 minutes, so with SU (switch user) is not possible, because we do not know the root password.

Second, from the root user to cut back to the user

To cut back from the root user, simply execute the command: SU User (User is the username of your own installation), or enter exit directly or ctrl+d the combo key to exit.

1 [email protected]:/home/hadoop# su hadoop2

Switching users of Linux commands

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.