Use of Su for user conversion problems in Linux

Source: Internet
Author: User

Su -- Super User

Su or su root: Convert the current identity to root, and the User Shell has not changed. therefore, some system commands cannot be used. su-, Su-l, or Su-l root can completely convert the current environment to the root environment. as root login directly. second, the path of the service is/sbin/service. If the shell does not change, NO/sbin is found in your path by default. Therefore, no result is returned. If you use the Su-command environment to change to root, path contains/sbin

Function Description: Change the user identity.

Syntax: su [-flmp] [-- help] [-- version] [-] [-C <command>] [-S] [User Account]

Note: su allows users to temporarily change their login identities. Enter the user account and password to be changed.

Parameters:
-C <command> or -- command = <command> restores the original identity after the specified command is executed.
-F or -- fast is applicable to CSH and Tsch, so that the shell does not need to read the Startup File.
-.-L or -- when login changes its identity, the working directory, home, Shell, user, and LOGNAME are also changed. In addition, the PATH variable is also changed.
-M,-P, or -- preserve-environment do not change environment variables when changing identities.
-S or -- shell = specifies the shell to be executed.
-- Help: displays help.
-- Version: displays the version information.
[User Account] specifies the user to change. If this parameter is not specified, it is changed to root by default.

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.