#################
(i) User name - u # # # user ID, only one)
- G # # user name
-GN UID the default is
/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
/usr/bin/ls
(ii) # # # View the current user 's user environment, that is, display the current echo $USER# # # Toggle the environment used by the current user
# #kiosk原本的环境
[Kiosk Echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/kiosk/.local/bin:/home/kiosk/bin
# #root原本的环境
[Root Echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bi N
# #root用su-kiosk Switch to kiosk while switching to Kiosk's own environment variable
[Root Su-kiosk
[Kiosk echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/kiosk/.local/bin:/home/kiosk/bin
# #root用su Kiosk switches to kiosk, but still root path, no path to the kiosk
[Root su Kiosk
[Kiosk Echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
su-student the difference between:
"-" the environment variables have also changed;
Actions for users and groups
User type
UID the value is B. System users: Protect the system operation of users, generally do not provide password login system,uid is 499
A. Store The user's basic properties, from which you can view all users of Linux. The format is:
B. Some strategies for storing user passwords in the following format:
/home/username /etc/skel/.* User Commands
- G Primary Group B. Modify User:usermod-d Root - G additional group list (comma separated) user name- g The user will be removed from the original additional group and can be used d. View all users:cat/etc/passwd
G. 2. User Group Type
B. Private user group: When creating a user, a user group with the same name will be created for the user if no user group is indicated. A private user group is actually a common user group.
A. Basic information about the storage group. The format is;
/etc/gshadow
User Group commands
———— If you do not specify groupadd-g 888 Test(Specify 888)
Modify Group:gruopmod-n New group name Group name groupmod-n Jack Jaak
———— cannot be deleted if there are users in the group
Cat/etc/gruop
Output:
Uid=0 (Root) gid=0 (root) groups=0 (root)
Add user to group:gpasswd-a user name Group name
Useradd # # # Specify the user's- G# # # Specify additional groups, the same group will exist
- D # # # Specifies the type of shell the user uses See userdel groupadd-g for the specified group Groupdel # # # change user password
###########
Useradd Add Useradd test
And then again:
Gid
Add user instructions (to delete test before it can be established)
Specify User home Directory
Specify the shell type used by the user
See the types of shells
 123
 123 123
 123
 123
 123
 123
 123
 123
&
 123
 123
 123
Linux Learning Note Four