The user creation process

A user, in the end is how it is created?

/ Etc / passwd user account information

/ Etc / shadow secure user account information

/ Etc / group Group account information

/ Etc / gshadow secure group account information

The default value of the / etc / default / useradd account creation. (It will use the default value in this file is not specified parameters)

[root @ Python ~] # CAT / etc / default / useradd 
# useradd Defaults File 
the GROUP = 100 # default set 
the HOME = / Home # default home directory 
INACTIVE = - 1 # whether to enable expired 
EXPIRE = # expiration time 
SHELL = / bin / bash # default shell 
sKEL = / etc / default folder skel # default home files copied from here 
CREATE_MAIL_SPOOL = yes # do not want to create a mailbox for the user

/ Etc / skel directory containing default files

[Python the root @ skel] # LL - A 
total volume of 24 
drwxr -XR-X.    . 3 the root the root    78 . 4 dated   . 11  2018 . 
drwxr -XR-X. 149 the root the root 8192 . 7 dated    2  . 19 : 35 ..
 -rw-R & lt --r--.    . 1 the root the root    18 is 10 dated 31 is  2018 .bash_logout
 -rw-R & lt -. r--    . 1 the root the root   193 10 dated 31 is  2018 .bash_profile
 -rw-R & lt -. r--    . 1 the root the root   231 October31 2018 .bashrc
drwxr-xr-x.   4 root root   39 5月  16 05:24 .mozilla

/etc/login.defs Shadow password suite configuration.

[root@python ~]# cat /etc/login.defs  
#
# Please note that the parameters in this configuration file control the
# behavior of the tools from the shadow-utils component. None of these
# tools uses the PAM mechanism, and the utilities that use PAM (such as the
# passwd command) should therefore be configured elsewhere. Refer to
# /etc/pam.d/system-auth for more information.
#

# *REQUIRED*
#   Directory where mailboxes reside, _or_ name of file, relative to the
#   home directory.  If you _do_ define both, MAIL_DIR takes precedence.
#   QMAIL_DIR is for Qmail
#
#QMAIL_DIR    Maildir
MAIL_DIR    /var/spool/mail
#MAIL_FILE    .mail

# Password aging controls:
#
#    PASS_MAX_DAYS    Maximum number of days a password may be used.
#    PASS_MIN_DAYS    Minimum number of days allowed between password changes.
#    PASS_MIN_LEN    Minimum acceptable password length.
#    PASS_WARN_AGE    Number of days warning given before a password expires.
#
PASS_MAX_DAYS    99999
PASS_MIN_DAYS    0
PASS_MIN_LEN    5
PASS_WARN_AGE    7

#
# Min/max values for automatic uid selection in useradd
#
UID_MIN                  1000
UID_MAX                 60000
# System accounts
SYS_UID_MIN               201
SYS_UID_MAX               999

#
# Min/max values for automatic gid selection in groupadd
#
GID_MIN                  1000
GID_MAX                 60000
# System accounts
SYS_GID_MIN               201
SYS_GID_MAX               999

#
# If defined, this command is run when removing a user.
# It should remove any at/cron/print jobs etc. owned by
# the user to be removed (passed as the first argument).
#
#USERDEL_CMD    /usr/sbin/userdel_local

#
# If useradd should create home directories for users by default
# On RH systems, we do. This option is overridden with the -m flag on
# useradd command line.
#
CREATE_HOME    yes

# The permission mask is initialized to this value. If not specified, 
# the permission mask will be initialized to 022.
UMASK           077

# This enables userdel to remove user groups if no members exist.
#
USERGROUPS_ENAB yes

# Use SHA512 to encrypt password.
ENCRYPT_METHOD SHA512 

 

The user is created, rely on these files are created.

Common things. . .

 

operation:

To create three user harry tom natasha

Additional requirements to the admin group harry tom

natasha allowed to log

 

Create a user to modify the default environment:

It requires the user's home directory is / home

uid, gid from the beginning of 1000

Login shell to / bin / csh

Claim:

Use useradd a

Creating a home directory is / rhome / a uid 100 gid 1000 shell: / bin / csh

Guess you like

Origin www.cnblogs.com/chengege/p/11123003.html