Linux instructions: User Management - SU

xiaoxiao2021-03-06  19

Name: su

Use permission: All users

How to use: Su [-fmp] [-c command] [-HELL] [- Help] [--Version] [-] [user [arg]]

Description: Changes to other users, except root, you need to type the user's password

parameter:

-f or -fast does not have to read boot files (such as csh.cshrc, etc.) only for CSH or TCSH

-m -p or --preserve-environment does not change environment variable when SU

-c command or --command = Command Changes to the user who accounts User and performs instructions (Command) and then change back to the original user

-S shell or --shell = shell Specifies the shell (Bash CSH TCSH, etc.) to be executed, the user (user) shell within / etc / passwd

--help display instruction file

--Version Display Version Information

- -l or --login This parameter is added, it seems that it is the same as the user, most of the environment variables (home shell user, etc.) is mainly based on the user (user), and work The directory will also change, if not specified User, the internal deflation is root

Users who want to change the account

ARG is incorporated into the new shell parameters

example:

Su -c ls root change account is root and exits returns to the original user after executing the LS instruction.

Su root -f change account is root and passes into the -f parameter to the newly executed shell.

Su - Clsung Change Account is CLSUNG and change the work directory to the CLSUNG home directory (Home Dir).

转载请注明原文地址:https://www.9cbs.com/read-41029.html

New Post(0)