View user list, create users and user groups under Linux

cat /etc/passwd|grep -v nologin|grep -v halt|grep -v shutdown|awk -F":" '{ print $1"|"$3"|"$4 }'|more


reference: http://www .cnblogs.com/wangkangluo1/archive/2011/09/23/2185977.html


asked about the meaning of various permissions under linux:
read 4
write 2
execute 1
777= read + write + execute
The first 7 is the current user,
the second One is the current user group, and
the third is other users, that is, all users can read and write to execute
755 The current user is read and written to execute, other read + execute

Refer to https://zhidao.baidu.com/question/106767267.html


useradd What does -m nginx -s /bin/bash mean? In particular, what do -m and -s mean here?
Hello, the meaning of the parameters of the useradd command is as follows, for reference:

-c<remark>: Add remark text. The remark text will be saved in the remark field of passwd;

-d<login directory>: specify the starting directory when the user logs in; -D: change the default value;

-e<valid period>: Specify the validity period of the account;

-f<buffer days>: Specify how many days after the password expires to close the account;

-g <group>: specify the group to which the user belongs;

-G<group>: Specifies the additional group to which the user belongs;

-m: Automatically create the user's login directory;

-M: Do not automatically create the user's login directory;

-n: Cancel the creation of a group named after the user name;

-r: Create a system account;

-s: Specifies the shell used by the user after logging in;

-u: Specifies the user id.


Reference: https://zhidao.baidu.com/question/492645750498660052.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326357895&siteId=291194637