File system access Control list:
Facl:filesystem Control List
Save additional access control permissions with file extensions
Setfacl
-M: Settings can be set on the user or group
U:uid:perm
G:gid:perm
setfacl-m [D: directory]U:MYGROUP:RW file name
setfacl-m [D: directory]G:MYGROUP:RW file name
-X: Cancel
U:uid:perm
Setfacl-x u: Group name File name
G:gid:perm
A few common commands:
1, WhoAmI
2. Who
-R: Displays the current run level
-S: Ignore
-H: Show Column Line
W.H.O. | Gerp Leo
3, W
4. Last
Display/var/log/xtmp file showing user login history and System restart history
-N #: Displays information about recent # times
5, lastb,/var/log/btmp file, display user error login attempt
-N #:
6, Lastlog: Show each user the last successful login information;
-u Username: Displays recent login information for a specific user
7, BaseName:
8. Mail
-S: Indicates "title" in command line status
Cat/etc/fstab | Mail-s "Hello" root
9. Sleep Delay
10. Hostname: Gets the current host name
11, SEQ: The step in the loop SEQ 1 3 Results 1 2 3
Generate random Number:
random:0-32768
Random Generator: Entropy pool
/dev/random (Strict, safe, random number runs out will block)
/dev/urangdom (not strictly required)
Terminal type:
Console: Consoles
Pty: Physical Terminal ("the")
TTY: Virtual Terminal (VGA)
TTYs: Serial Terminal
pts/#: Pseudo Terminal
Shell
#! /bin/bash
#检查用户david是否登陆, check every 5 seconds to see David Log out of this script
DECLARE m=9
N= ' who | grep "Leo" | Wc-l '
for [$m-ne 0];d o
If [$n-eq 0]; Then
echo "Leo user logged in"
exit:0
Fi
Sleep 5
Done
Linux---facl and terminals