【正文】
安全性日志 (3) 6. 2. 2 文件和目錄的存取許可權(quán) 許可權(quán) ls ld /bin/passwd /tmp rsrxrx 1 root security 17018 Jul 30 2023 /bin/passwd drwxrwxrwt 8 bin bin 16384 Apr 16 20:08 /tmp 用戶執(zhí)行 passwd 命令時(shí)他們的有效 UID將改為 root 的 UID 更改許可權(quán) example: chmod +t dir1 or chmod 1770 dir1 (SVTX) chmod g+s dir2 or chmod 2775 dir2 (SGID) chmod u+s dir3 or chmod 4750 dir3 (SUID) 更改所有者 example: chown zhang file1 chgrp staff file1 chown zhang:staff file umask umask 決定新建文件和目錄的缺省許可權(quán) /etc/security/user 指定缺省的和個(gè)別用戶的 umask 值 系統(tǒng)缺省 umask=022 ,取 umask=027 則提供更嚴(yán)格的 許可權(quán)限制 umask=022 創(chuàng)建的文件和目錄缺省許可權(quán)如下: 普通文件 rwrr 目錄 rwxrxrx 6. 2. 3 安全性文件 /etc/passwd 合法用戶(不含口令) /etc/group 合法組 /etc/security 普通用戶無(wú)權(quán)訪問(wèn)此目錄 /etc/security/passwd 用戶口令 /etc/security/user 用戶屬性、口令約束等 安全性文件 (2) /etc/security/limits 用戶使用資源限制 /etc/security/environ 用戶環(huán)境限制 /etc/security/ 登錄限制 /etc/security/group 組的屬性 6. 2. 4 合法性檢查 pwdck 驗(yàn)證本機(jī)認(rèn)證信息的合法性 命令格式: pwdck {n|p|t|p} {ALL | username } 該命令用來(lái)驗(yàn)證本機(jī)認(rèn)證信息的合法性,它將檢查 /etc/passwd 和 /etc/security/passwd 的一致性以 及 /etc/security/ 和 /etc/security/user 的 一致性 usrck 驗(yàn)證用戶定義的合法性 命令格式: usrck { n | p | t | y } { ALL | username } 該命令檢查 /etc/passwd、 /etc/security/user 、 /etc/limits 和 /etc/security/passwd中的用戶信息, 同時(shí)也檢查 /etc/group和 /etc/security/group 以保 證數(shù)據(jù)的一致性 合法性檢查 (2) grpck 驗(yàn)證組的一致性 命令格式: grpck { n| p| t |y } {ALL |username } 該命令檢查 /etc/group 和 /etc/security/group 、 /etc/passwd 和 /etc/security/user之間的數(shù)據(jù)一致 性 合法性檢查 (3) 命令參數(shù)的含義: n ——報(bào)告錯(cuò)誤但不作修改 p ——修改錯(cuò)誤但是不輸出報(bào)告 t ——報(bào)告錯(cuò)誤并等候管理員指示是否修改 y ——修改錯(cuò)誤并輸出報(bào)告 合法性檢查 (4) 6. 2. 5 安全性策略要旨 劃分不同類(lèi)型的用戶和數(shù)據(jù) 按照分工的性質(zhì)組織用戶和組 遵循分組結(jié)構(gòu)為數(shù)據(jù)設(shè)置所有者 為共享目錄設(shè)置 SVTX位 6. 2. 6 測(cè)試題 1. A user is able to get a login prompt for the server 2. but gets a failed login error message when trying to 3. login with an ID. Which of the following is the most 4. likely cause of this problem? A. The hard drive is bad. B. The /home file system is full. C. The server is low on paging space. D. The user has entered an invalid ID or password. 測(cè)試題 (2) 2. Which of the f