A detailed explanation of Linux commands su

Source: Internet
Author: User

Su allows a user to temporarily become another user. It executes a command with a true and valid user ID, group ID, and an additional group of given user, usually an interactive shell.

Su[option] ... [USER [ARG] ...]

If user is not specified, the default is root, and if user has a password and is not a superuser, prompts for a password.

By default, SU does not change the current directory, and the home and shell are changed according to user, and user and logname are set if they are not superuser. By default, the shell is not a login shell.

Additional args can be passed to the shell as parameters;

Options:

-C COMMAND,--Command=command

Pass command to Shell

-F,--Fast

-,-L,--Login

Make Theshell a login shell

-m,-p,--preserve-environment

-sshell,--Shell=shell

Run the shell, not from user ' spasswd entry,

Exit value

125:SU itself failed to run

126: If Subshell is found but cannot be invoked

127: Subshell not found

Otherwise, it's Subshell's exit status.

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.