Linux command _ User identity switch

Source: Internet
Author: User
Command su

The format is:su [-] username, the back can follow-, also can not follow.

When a normal user's SU command is not username, it is equivalent to switching to the root user and vice versa. When the SU command is added-the various environment variables of the current user are initialized.

If you do not add-switch to the root user, the current directory does not change, and if you add-switch to the root account, the current directory is the home directory of the root account.

Note: When you switch from root to a normal user, you do not need to enter a password .

Command sudo

Because the current directory or the/root,zoctopus account does not have any permissions after switching to the Zoctopus account, I will not be prompted enough when I use the command ls to view it. However, when I use sudo ls to enter the Zoctopus account's own password, I have this permission.

Linux command _ User identity switch

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.