你們好,我是霸王卸甲,昨天由於工做上的事情,忘記更了,今天上午補上昨天的文章,每週週六週日停更兩天。ide
1.用戶/組基本概念: ①概念:Users and groups:
. Every process (running program) on the system runs as a particular user.
. Every file is owned by a particular user.
. Access to files and directories are restricted by user.
. The user associated with a running process determines the files and directories accessible to that process.
②查看當前登陸的用戶信息:rest
③查看文件的owner:[root@tianyun ~]# ll /home/ drwx------. 4 alice alice 4096 Jun 2 15:59 alice drwx------. 2 root root 16384 Jun 1 23:09 lost+found drwxr-xr-x 2 root root 4096 Jun 2 15:33 tianyun ④查看運行進程的username:USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 19360 1536 ? Ss 13:29 0:00 /sbin/init root 2 0.0 0.0 0 0 ? S 13:29 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? S 13:29 0:00 [migration/0] root 4 0.0 0.0 0 0 ? S 13:29 0:00 [ksoftirqd/0]
2.用戶/組管理:首先給你們講的是用戶以下圖code
而後是用戶組:用戶組又分爲基本組和附加組
1建立用戶
#useradd testA
#useradd testBblog
2 查看用戶UID/GID
#cat /etc/passwd
testA:X:1000:1000 (UID:GID-基本組ID)
testB:X:1001:1001進程
3 建立個新組,查詢組ID爲1002.
#groupadd groupT
#cat /etc/group
goutpT::1002:ci
4 請用「usermod -g」修改用戶的基本組爲1002.
#usermod -g groupT testAit
5 查詢用戶GID,由1000,更改成1002
#cat /etc/passwd
testA:X:1000:1002 (UID:GID-基本組ID)
testB:X:1001:1001io
附加組:1建立用戶
#useradd testA
#useradd testB
2 查看組信息
#cat /etc/group
testA::1001:
testB::1002:
3 將用戶加入其餘組。
語法 -G 附加組 組名 用戶名
usermod -G testB testA
4 查看附加組的成員
#cat /etc/group
testA::1001:
testB::1002:testA(用戶)class
提權(瞭解):這個部分你們瞭解下就能夠了、thread
**今天的文章就到這裏了,感謝你們的支持,在這裏給你們道個歉,由於本人感冒,文章內容結構會整理的不太好,請你們多多包容,謝謝你們,明天見。**