033-Unit 10 Advanced Topics in Users ,Groups and Permissions
User and Group ID Numbers
/etc/passwd :User database
/etc/shadow : Password database
/etc/group : Group database
System User and Group : 1-499 for system
changing your indentity : chang password : passwd command
passwd --status user1
su user1 切换账号
su - user1 切换账号和环境变量(run login shell)
whoami command
groups command
id command
users , who , w command to display users
last command show login history
default permission for file is 666 ; for directory is 777
umask command : default root 022 , other 002 ; so for root file is 644 , directory is 755 ;
and other user file is 664 , directory is 755
Special Permissions : suid 4(u+s), sgid 2(g+s), sticky 1(0+t) 小写有x权限,大写没有x权限
chmod u+s xxx.txt or chmod 4755 xxx.txt
suid : run as command owner user (ex. /bin/ping)
sticky bit : only owner and root cat remove files in the directory
sgid : only members of the group can build files in the directory