{
 "使用者與群組的底層:passwd、shadow、group#2": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "cards": [
   {
    "title": "root",
    "points": [
     "UID 0",
     "超級使用者",
     "不受權限限制"
    ]
   },
   {
    "title": "系統帳號",
    "points": [
     "UID 1~999",
     "www-data、sshd",
     "通常不能登入"
    ]
   },
   {
    "title": "一般使用者",
    "points": [
     "UID 1000 以上",
     "分界在 login.defs"
    ]
   }
  ]
 },
 "使用者與群組的底層:passwd、shadow、group#4": {
  "type": "table",
  "head": [
   "密碼欄",
   "意思"
  ],
  "rows": [
   [
    "! 或 !!",
    "密碼被鎖定"
   ],
   [
    "*",
    "沒有可用密碼"
   ]
  ],
  "reveal": [
   0,
   1,
   2
  ],
  "widths": [
   1,
   2
  ]
 },
 "使用者與群組的底層:passwd、shadow、group#5": {
  "type": "table",
  "head": [
   "檔案",
   "內容",
   "誰能讀"
  ],
  "rows": [
   [
    "/etc/passwd",
    "帳號基本資料",
    "所有人"
   ],
   [
    "/etc/shadow",
    "密碼雜湊與期限",
    "root 與特定群組"
   ],
   [
    "/etc/group",
    "群組與成員",
    ""
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "widths": [
   2,
   2,
   2
  ]
 },
 "使用者與群組的底層:passwd、shadow、group#6": {
  "type": "flow",
  "reveal": [
   0,
   2,
   7,
   7
  ],
  "nodes": [
   {
    "label": "名稱",
    "sub": "alice",
    "color": 0
   },
   {
    "label": "密碼佔位",
    "sub": "x",
    "color": 1
   },
   {
    "label": "UID",
    "sub": "1000",
    "color": 2
   },
   {
    "label": "GID",
    "sub": "1000",
    "color": 3
   },
   {
    "label": "說明",
    "sub": "Alice Chen",
    "color": 4
   },
   {
    "label": "家目錄",
    "sub": "/home/alice",
    "color": 5
   },
   {
    "label": "shell",
    "sub": "/bin/bash",
    "color": 6,
    "kind": "end"
   }
  ],
  "layout": "snake"
 },
 "建立、修改與刪除帳號#1": {
  "type": "table",
  "head": [
   "指令",
   "特性"
  ],
  "rows": [
   [
    "useradd",
    "底層工具,不會問問題"
   ],
   [
    "adduser",
    "Debian 友善包裝,互動詢問"
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   2,
   2,
   2
  ],
  "widths": [
   1,
   2
  ]
 },
 "建立、修改與刪除帳號#3": {
  "type": "flow",
  "reveal": [
   0,
   1,
   2,
   2,
   2,
   3
  ],
  "nodes": [
   {
    "label": "useradd",
    "sub": "-m -s -c",
    "color": 0
   },
   {
    "label": "passwd",
    "sub": "alice",
    "color": 1
   },
   {
    "label": "設定成功",
    "sub": "updated successfully",
    "color": 2,
    "kind": "end"
   }
  ]
 },
 "建立、修改與刪除帳號#5": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   2
  ],
  "cards": [
   {
    "title": "usermod -G",
    "points": [
     "只寫大寫 G",
     "附屬群組被取代",
     "sudo、docker 全移除"
    ]
   },
   {
    "title": "usermod -aG",
    "points": [
     "a 與 G 成對",
     "追加群組",
     "保留原有群組"
    ]
   }
  ]
 },
 "sudo 與 sudoers 安全設定#2": {
  "type": "table",
  "head": [
   "發行版",
   "授權群組"
  ],
  "rows": [
   [
    "Ubuntu / Debian",
    "sudo"
   ],
   [
    "Red Hat 系列",
    "wheel"
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   2
  ]
 },
 "sudo 與 sudoers 安全設定#4": {
  "type": "table",
  "head": [
   "指令",
   "用途"
  ],
  "rows": [
   [
    "sudo -l",
    "列出我能做什麼"
   ],
   [
    "sudo -i",
    "開 root 登入 shell"
   ],
   [
    "sudo -u 使用者",
    "以指定身分執行"
   ],
   [
    "sudo -k",
    "清除密碼快取"
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ]
 },
 "sudo 與 sudoers 安全設定#6": {
  "type": "table",
  "head": [
   "規則",
   "意思"
  ],
  "rows": [
   [
    "誰 主機=(身分) 指令",
    "規則的格式"
   ],
   [
    "alice ALL=(ALL:ALL) ALL",
    "alice 可做任何事"
   ],
   [
    "%ops ALL=(ALL:ALL) ALL",
    "ops 群組全部權限"
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   3
  ]
 },
 "帳號稽核與共用目錄(setgid)#4": {
  "type": "table",
  "head": [
   "選項",
   "用途"
  ],
  "rows": [
   [
    "chage -d 0",
    "下次登入須改密碼"
   ],
   [
    "chage -M 90",
    "密碼最長 90 天"
   ],
   [
    "chage -E 日期",
    "設定帳號到期日"
   ],
   [
    "chage -E 0",
    "帳號立刻到期"
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ]
 },
 "帳號稽核與共用目錄(setgid)#6": {
  "type": "flow",
  "reveal": [
   0,
   0,
   0,
   1,
   2,
   3
  ],
  "nodes": [
   {
    "label": "鎖密碼",
    "sub": "usermod -L",
    "color": 0
   },
   {
    "label": "立即到期",
    "sub": "chage -E 0",
    "color": 2
   },
   {
    "label": "禁登入",
    "sub": "nologin",
    "color": 4,
    "kind": "end"
   }
  ]
 },
 "帳號稽核與共用目錄(setgid)#7": {
  "type": "table",
  "head": [
   "設定",
   "作用"
  ],
  "rows": [
   [
    "chmod 2770",
    "setgid:新檔繼承 devs 群組"
   ],
   [
    "umask 002",
    "群組才能寫入"
   ],
   [
    "chmod 3770",
    "加上 sticky bit"
   ]
  ],
  "reveal": [
   0,
   1,
   1,
   2,
   3
  ],
  "widths": [
   1,
   2
  ]
 }
}