#useradd -g whh -d /software/whh whh Create user whh, join WHH Group, home directory under/SOFTWARE/WHH # useradd -s /sbin/nologin -m wxh Create a user who cannot log on to the system and has no home directory wxh# useradd -g adm -d /home/twsdsadm/ adm Create user ADM, belong to ADM Group, home directory/home/adm/# usermod -u 34085 adm Change uid# groupmod -g 5010 mercury Change gid# usermod -ag stage,port adm appends the user ADM to the Stage,port group, separated by commas between multiple groups # gpasswd -a test test2 Add user test to the Test2 group # gpasswd -d test test2 Remove the user test from the Test2 group # usermod -g Group name user (group must exist) Modify user's basic group modify test user's home directory $ usermod -md /home/usertest user name $ usermod -d /usr/newfolder -u uid -u must be followed by the UID, not username instance analysis # groupadd -g 5010 test;useradd -g test -u 5010 -d /home/ Test test# echo "123456" | passwd --stdin test;usermod -a -g othergroup test;id test New group test and specify GID, new user test join group test, home directory/home/test, password 123456, and then add the user to the Othergroup group.
File permissions
The normal file defaults to 644, which is:
-rw-r--r--1 root root 0 May15 20:04 test
Self-read/write (rw), the same group of people have read (R), others have read (R)
Default permissions can be modified by umask
The default umask is 022
File: 666-022 = 644
Table of Contents: 777-022 = 755
If you have umask 011, the resulting file directory permissions will become:
File: 666-011 = 655
Table of Contents: 777-011 = 766
Linux command-New user