Cat > F1 << EOF Multi-line submission
Mail-s Test user1 << End
> Nice to meet u
> Let ' s Go
> End
ll/etc/| Less paging display
ls/tmp | Tee/tmp/a.log
Tee Command Save information,-a append
TR [[: Lower:]] [[: Upper:]] < F1 convert standard input of F1
Xecho ASDFG |& tr ' A-Z ' A-Z ' equivalent notation:
Xecho ASDFG 2>&1 | tr ' A-Z ' A-Z '//
TR [option] Set1 Set2
-c,--complement: Complementary set
-D: Delete all characters belonging to the first character set
-T: Remove characters from the first character set that are more than the second character set
-s,--squeeze-repeats: Repeats consecutive characters in a single character
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/85/4C/wKiom1efUBqwjAHIAAHhf0jaPnA484.png "title=" TR option. png "width=" "height=" 722 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:722px; "alt=" Wkiom1efubqwjahiaahhf0japna484.png "/>
Getent passwd user1
Getent Shadow User1
Getent Group User1
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/85/4C/wKioL1efUO3Ros0OAACauA6PfJk332.png "title=" Getent.png "width=" "height=" 127 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:700PX;HEIGHT:127PX; "alt=" Wkiol1efuo3ros0oaacaua6pfjk332.png "/>
Useradd Tom in the/home/to generate the Tom directory, belong to the main group of Tom
Userdel Tom/home/tomcat, the genus of the main genera, the ID number
Useradd Alice/home/tomcat of the genus Alice
pwunconv: PAWWD Unconvert does not convert,/etc/shadow file is not, before the shadow file stored encrypted password displayed in the second bit of/etc/passwd
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/85/4C/wKioL1efUsvyIl30AABYYg_Ew_o592.png "title=" Pwunconv.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:55px; "alt=" Wkiol1efusvyil30aabyyg_ew_o592.png "/>
pwconv: Shadow File Recovery
ID 0 is the administrator, if the/etc/passwd root and other users such as User1 UID swapped, then user1 as the administrator, root for the ordinary user
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/85/4C/wKioL1efVDaQIJLNAAA1c0sAVpo822.png "title=" id=0. PNG "width=" height= "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:700PX;HEIGHT:57PX; "alt=" Wkiol1efvdaqijlnaaa1c0savpo822.png "/>
CHFN User1 Modify Name,phone,office,shell information
Finger Command View
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/85/4C/wKiom1efVNewRxdGAABtGvRnka8257.png "title=" Finger.png "width=" "height=" 169 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:700PX;HEIGHT:169PX; "alt=" Wkiom1efvnewrxdgaabtgvrnka8257.png "/>
Getent passwd user1 display
user1:x:1001:1001: User 1,magedu,010,12315:/home/user1:/sbin/nologin
Chsh-s/sbin/nologin User1
Change the shell of User1, this user cannot log in
Usermod-l Alice//Lock Login
Usermod-u Alice//Unlock login, will remove an exclamation mark
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/85/4F/wKioL1ef9qzyYZ1-AADPNb6jjvA552.png "title=" Lu parameter. png "Width=" "height=" 158 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:158px; "alt=" Wkiol1ef9qzyyz1-aadpnb6jjva552.png "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/85/50/wKioL1ef--XyeJySAACQgEcVdTM401.png "title="-u.png "Width=" "height=" 151 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:151px; "alt=" Wkiol1ef--xyejysaacqgecvdtm401.png "/>
Authconfig--passalgo=sha256--update//Update encryption algorithm
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/85/50/wKioL1egAtfStsQJAAF8qLCNDSk369.png "title=" Authconfig.png "width=" "height=" 385 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:385px; "alt=" Wkiol1egatfstsqjaaf8qlcndsk369.png "/>
OpenSSL rand-base64 10//
/etc/passwd each meaning- user name: password: User identification number: Group ID: annotative Description: Home directory: Login Shell
echo $[' date +%s '/86400]//output 17014,unix number of days to today
Windows cmd> Net accounts see the password for a maximum age of 42 days
Passwd-e Alice//Alice user login prompts for password change
/etc/group user1:x:1001: After adding Alice, add Alice to the User1 group
ID Alice or groups Alice to see the group information that Alice belongs to
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/85/51/wKiom1egCFOwtKl4AABD0UfRBfM147.png "title=" Idgroups.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:125px; "alt=" Wkiom1egcfowtkl4aabd0ufrbfm147.png "/>
Usermod-ag User2 Alice//Add Alice to the User2 group
alice# newgrp user2//Temporary switch main group, exit exit
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/85/52/wKiom1egDuSDwdQdAADdiYUoPAQ429.png "title=" Newgrp.png "width=" "height=" 281 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:281px; "alt=" Wkiom1egdusdwdqdaaddiyuopaq429.png "/>
VIPW command to modify/ETC/PASSWD content
VIGR command to modify/etc/group content
PWCK command Check password file
GRPCK command Inspection of the file
Useradd-u 0-o Rooter
useradd-d/testdir/user4 user4//Automatically create home directory useradd-d//display default user information, can be modified in/etc/default/useradd
The. bash_profile files in the home directory are all originated from the/etc/skel
/etc/login.defs can change the password expiration time, length and other properties
Usermod-u 20010-g user1-g bin,root-s/bin/csh-d/testdir/hehedir-m-C "hehe test"-l NEWHEHE-E 2017-08-01-f Ten heh E
-M: Migrating home Directory-L: New name-e: Specify user account expiration date-F: Expiration How many days are locked
Groupmems-l-G root//view the user of the root group groupmems-d alice-g bin//Remove the Alice user from the bin group groupmems-a alice-g root//Will Alice Add to root group groupmems-p-G bin//To empty the bin group user,-p,--purge
Groups Newhehe//See which groups Newhehe users belong to
Usermod-g "" Alice//Remove Alice's secondary group
strace command to view system calls
SU-XXX login switch, will read the target user's profile, switch to home directory, completely switch
Su XXX non-logon switch, that is, does not read the target user's profile, does not change the current working directory
Su [-] username-c ' COMMAND '
Su-root-c ' Cat/etc/shadow '//switch to root, execute command, and then exit--Triad
0801linux Basic Content Small note