-
Super administrator user root 0
-
general user
-
System users: Some users used to start the system services and processes, not landing 1-999 (centos7) 1-499 (centos6)
-
Users can visit: the user can log 1000-65535 (centos7) 500-65535 (centos6)
-
Usage: useradd [Options] LOGIN
useradd -D
useradd -D [Options]
regular user id is incremental, system user id is decreasing
-d to specify the user's home directory
-g id specified user group
-G specified user additional group
-k designated copy contents of that folder, and need to be used with -m
-m create the user's home directory
-c "the message" specified user description of
-N Do not create a group with the same name, to users for the group
- s login user specify the shell
-u specified user ID
-D displays the default configuration of the system
-D [options] can modify the default configuration of the system
-
Related documents
-
/ Etc / default / useradd to create the user's default file
-
/ Etc / skel / * default file copying
-
Users modify usermode
-c modify the description
-d modify the home directory, default will not create a new directory, if you want to move home directory, you need to use -m
-g modify user group
additional groups -G modify the user's default is to replace
-a Append additional group
-l newname modify the user's login name
-L lock the user can not log in, change the password to unlock the next time default
-U unlock a user
-s modify the user login shell
-u modify the user's uid
-e year - month - modify the user's expiration date, expired can not log on after
Delete User USERDEL
Delete the default user does not delete the user's home directory
-r delete home directory
-f force the deletion
by default, the user is logged in user can not be deleted, later forced to delete a user, the user can still use
View user id information
-g only have the group the above mentioned id
-G displays only an additional set of the above mentioned id
-u only user the above mentioned id
-n display name, and needs to be used in conjunction guG
Switch User
su [options] [-] [USER [arg]...]
User switching manner
-
Complete switch: su - username to log-type switch, environment variables, etc. will switch
-
Incomplete switch: su username will not switch the user's home directory environment variables, etc.
-
switching ordinary users do not need root password, a password is required to switch the non-root
Switch User command execution
[root@localhost ~]#su - peiqi -c "whoami"
peiqi
Command execution itself can not be executed
sudo configuration file is / etc / sudoers
peiqi ALL = (ALL) NOPASSWD: ALL
which is not required to enter a password NOPASSWD
/ Etc / passwd file
-
user name
-
Password to use x placeholder
-
uid
-
guide
-
Description
-
Home directory
-
After you log in using the shell
Password passwd
passwd [OPTION ...] <accountName>
-d Delete the specified user's password, the password can not log in after deleting
-l Lock user
-u unlock the user
-e after the next login to force the user to change the password
-f Forces operating
-x maxday password the longest time
-n shortest time minday password
-w warnday how long before password expiration reminder
-i inactiveday how long after the expiration disable password
--stdin read the password from standard input echo '123' | passwd - stdin peiqi
Storage file / etc / shadow
-
username
-
$ Password encryption (default SHA512) the encrypted character string $ $ $ salt
-
From January 1, 1970 to change the password after the last time
-
Minimum time password (0 means can be modified at any time)
-
Password longest time (99999 represents never expires)
-
How long password expiration reminder (default week)
-
How long lock password expiration
-
From January 1, 1970 start date, how long accounts fail
Password complexity policy
-
It must include numbers, uppercase and lowercase, special characters
-
Password must be at least 12
-
Not for the weak passwords
-
You must be a random password
-
Three months or six months modified once
Machine-free dense Login
ssh-keygen way to enter
ssh-copy-id to log on machines
Modify the user password policy chage
-E
the -I
-m
-M
-W
Change the Login can be used interactively modify password policy
chfn modify the user's personal information
user group
-
Power Users group root 0
-
Ordinary User Group
-
System user group 1-999 (centos7) 1-499 (centos6)
-
Users can visit the group 1000-65535 (centos7) 500-65535 (centos6)
-
groupadd
-g Specifies the group the above mentioned id
-r Create a system user group
Group files
/etc/group
-
group name
-
Password placeholder
-
guide
-
Group members
/etc/gshadow
-
group name
-
password
-
Group administrator's password
-
Group members
Modify group information
groupmod
-g modify gid
-n modify the group name
Delete Group
groupdel delete group
software
windows exe
centos(redhat) rpm
rpm: radhat package manager
rpm (manual dependency resolution)
yum (automatically resolve dependencies)
Naming convention package
MySQL-python-1.2.5-1.el7.x86_64.rpm
name - version (major version small version of the revision.) - packaged version available system architecture .rpm..
Architecture:
x86_64
x86
i386
i486
i686
ppc
noarch stands for General
Source package
-
CD
-
Third-party sites
-
Official website
-
do it yourself
-
third party package combination epel
Query the rpm package
RPM -q query specified package is installed
-a all that the current system all the packages installed
-f filename query specified files installed by that package generated
-c check the specified package which generates the configuration file
-d specified query packet generation What documents
-i queries the specified package of detailed information
-l query specified package file to generate
common options
-qi
-qa
-ql
-qc
-qd
yum
yum will automatically resolve dependencies
Warehouse storage of a plurality of packets and metadata packets (where warehouse, dependencies)
Warehouse Location:
-
http://
-
https: //
-
ftp: //
-
file: // (local file)
-
Configuration files are stored in /etc/yum.repos.d
yum configuration file
[Base] # Name
name = CentOS- $ the releasever - Base - mirrors.aliyun.com # description
failovermethod = priority # define the priority order of selection of the random sequence roundrobin
BaseURL = HTTP: //mirrors.aliyun.com/centos/ $ the releasever / OS / $ basearch /
http://mirrors.aliyuncs.com/centos/ $ the releasever / OS / $ basearch /
http://mirrors.cloud.aliyuncs.com/centos/ $ the releasever / OS / $ basearch /
Enabled = {0 | 1} is enabled, 1 enabled, 0 is not enabled
gpgcheck = {0 | 1} use check
gpgkey = HTTP: //mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 # school test file
defaults
$ releasever release
$ Basearch System Architecture
yum source
-
Ali
-
163
-
sohu
-
Tencent
-
North
-
USTC School
-
。。。。
yum command
-
yum repolist view warehouse
-
Front package repository yum list lists all packages installed with @
-
yum install installation package
-
yum reinstall reinstall
-
yum update update all packages
-
yum update pkg update the specified packages
-
yum downgrade downgrade
-
Yum check-update checks whether the package can update
-
yum remove uninstalled packages
-
yum info pkg show details of the packet
-
yum clean all remove metadata information
-
yum makecache rebuild metadata information
-
yum search search packages (package name, description, information can be included as long as the search out)
-
yum provides command search is provided by which packages
Package Group
-
yum grouplist view the package groups
-
yum groupinstall installation
-
yum groupinfo obtain information packet, view the package groups which make up the package
-
yum groupupdate update
-
yum groupremove uninstall the package group
Options command yum
-y automatic confirmation
-q silent mode
Source Installation
-
Download wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
-
Unzip the file tar xf
-
Change directory cd
-
You can view the help file README INSTALL
-
Install the necessary files
-
Compile (the required inspection program file) ./ configure
-
Construction of the installation program make
-
The installer make install
-
Configuration environment variable