rpmbuild的安裝包無(wú)法執(zhí)行腳本 如何在linux上用命令實(shí)現(xiàn)用戶和組的管理?
如何在linux上用命令實(shí)現(xiàn)用戶和組的管理?Linux上用命令實(shí)現(xiàn)本地用戶和組的管理本地用戶和組:管理文件和進(jìn)程等等本地用戶和組:1)root: 超級(jí)管理員 系統(tǒng)創(chuàng)建的第一個(gè)賬戶特點(diǎn):id為:0家目錄
如何在linux上用命令實(shí)現(xiàn)用戶和組的管理?
Linux上用命令實(shí)現(xiàn)本地用戶和組的管理
本地用戶和組:管理文件和進(jìn)程等等
本地用戶和組:
1)root: 超級(jí)管理員 系統(tǒng)創(chuàng)建的第一個(gè)賬戶
特點(diǎn):
id為:0
家目錄:/root
具有系統(tǒng)的完全控制權(quán): 小心使用。
[ ~]# id
uid0(root) gid0(root) groups0(root) contextunconfin:unconfin:unconfin:s0-s0:c0.c1023
[ ~]#
2)普通用戶: 不具有管理員權(quán)限
特點(diǎn):
id范圍:
1000 lt id lt60000
家目錄: /home/用戶名
[ ~]# id student
uid1000(student) gid1000(student) groups1000(student),10(wheel)
[ ~]#
3)服務(wù)用戶: 為服務(wù)提供權(quán)限
特點(diǎn):
id范圍:
0 lt id lt 1000
家目錄:應(yīng)用程序服務(wù)目錄
[ ~]# id apache
uid48(apache) gid48(apache) groups48(apache)
[ ~]#
如果是yum,rpm安裝的軟件: 由rpm包中的腳本創(chuàng)建服務(wù)賬戶
Include *.conf
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# Us: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User apache
Group apache
# Main server配置#本地組:1)主要組:用戶必須屬于主要組。當(dāng)一些用戶創(chuàng)建一個(gè)文件時(shí),給該文件所屬的組。2)下屬組:用戶容器,組織管理用戶權(quán)限??刂平巧?文件: