{
 "架站前的規劃與新主機初始化#2": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ],
  "cards": [
   {
    "title": "跑什麼服務",
    "points": [
     "網站、資料庫",
     "檔案分享、DNS",
     "服務越少越安全"
    ]
   },
   {
    "title": "誰登入",
    "points": [
     "用什麼身分",
     "不共用 root"
    ]
   },
   {
    "title": "開放埠",
    "points": [
     "22、80、443"
    ],
    "value": "22 / 80 / 443"
   },
   {
    "title": "資料與備份",
    "points": [
     "放在哪裡",
     "第 7、8 章"
    ]
   },
   {
    "title": "發行版",
    "points": [
     "Ubuntu LTS",
     "約 5 年安全更新"
    ]
   }
  ]
 },
 "架站前的規劃與新主機初始化#3": {
  "type": "flow",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "nodes": [
   {
    "label": "更新套件",
    "color": 0,
    "sub": "清單與已裝套件"
   },
   {
    "label": "主機名與時區",
    "color": 1,
    "sub": "日誌時間對得上"
   },
   {
    "label": "管理帳號",
    "color": 2,
    "sub": "不長期用 root"
   }
  ]
 },
 "架站前的規劃與新主機初始化#4": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "head": [
   "步驟",
   "指令"
  ],
  "rows": [
   [
    "登入",
    "ssh root@192.0.2.10"
   ],
   [
    "更新清單",
    "apt update"
   ],
   [
    "升級套件",
    "apt upgrade -y"
   ],
   [
    "主機名稱",
    "hostnamectl set-hostname web01"
   ]
  ],
  "widths": [
   2,
   5
  ]
 },
 "架站前的規劃與新主機初始化#5": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "head": [
   "步驟",
   "指令"
  ],
  "rows": [
   [
    "設定時區",
    "timedatectl set-timezone Asia/Taipei"
   ],
   [
    "檢查時間",
    "timedatectl"
   ],
   [
    "建立帳號",
    "adduser deploy"
   ],
   [
    "加入群組",
    "usermod -aG sudo deploy"
   ]
  ],
  "widths": [
   2,
   5
  ]
 },
 "架站前的規劃與新主機初始化#6": {
  "type": "flow",
  "reveal": [
   0,
   2,
   3,
   4
  ],
  "nodes": [
   {
    "label": "另開視窗",
    "color": 0
   },
   {
    "label": "deploy 登入",
    "color": 1
   },
   {
    "label": "sudo whoami",
    "color": 2
   },
   {
    "label": "回應 root",
    "color": 3,
    "sub": "有管理權限"
   }
  ]
 },
 "架站前的規劃與新主機初始化#7": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "cards": [
   {
    "title": "先關 root 登入",
    "points": [
     "未確認新帳號",
     "整台機器進不去"
    ],
    "value": "保留舊視窗"
   },
   {
    "title": "忘了設時區",
    "points": [
     "日誌是 UTC",
     "差八個小時"
    ]
   },
   {
    "title": "密碼太弱",
    "points": [
     "用密碼管理器",
     "16 字元以上"
    ],
    "value": "16 字元以上"
   }
  ]
 },
 "SSH 金鑰登入原理與設定#1": {
  "type": "flow",
  "reveal": [
   0,
   0,
   3,
   5
  ],
  "nodes": [
   {
    "label": "產生金鑰對",
    "color": 0,
    "sub": "自己的電腦"
   },
   {
    "label": "私鑰留身邊",
    "color": 1,
    "sub": "不外流"
   },
   {
    "label": "公鑰放伺服器",
    "color": 2
   },
   {
    "label": "伺服器出題",
    "color": 3,
    "sub": "只有私鑰解得開"
   },
   {
    "label": "答對放行",
    "color": 4
   }
  ]
 },
 "SSH 金鑰登入原理與設定#2": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "head": [
   "選項",
   "用途",
   "範例"
  ],
  "rows": [
   [
    "-t",
    "指定演算法",
    "ed25519"
   ],
   [
    "-C",
    "註解",
    "alice@laptop"
   ],
   [
    "passphrase",
    "加密私鑰",
    "建議設定"
   ]
  ],
  "widths": [
   2,
   3,
   3
  ]
 },
 "SSH 金鑰登入原理與設定#6": {
  "type": "flow",
  "reveal": [
   0,
   2,
   3,
   4
  ],
  "nodes": [
   {
    "label": "你的公鑰",
    "color": 0
   },
   {
    "label": "ssh-copy-id",
    "color": 1,
    "sub": "此時仍允許密碼"
   },
   {
    "label": "authorized_keys",
    "color": 2,
    "sub": "伺服器 ~/.ssh"
   },
   {
    "label": "檢查權限",
    "color": 3,
    "sub": "過鬆會被拒絕"
   }
  ]
 },
 "SSH 金鑰登入原理與設定#7": {
  "type": "bar",
  "reveal": [
   0,
   0,
   1,
   1,
   2
  ],
  "labels": [
   "~/.ssh 目錄",
   "金鑰檔"
  ],
  "values": [
   700,
   600
  ],
  "unit": ""
 },
 "強化 sshd_config 與防火牆#1": {
  "type": "flow",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "nodes": [
   {
    "label": "備份設定檔",
    "color": 0
   },
   {
    "label": "保持視窗開著",
    "color": 1,
    "sub": "不要關"
   },
   {
    "label": "檢查語法",
    "color": 2,
    "sub": "再 reload"
   },
   {
    "label": "第二個連線",
    "color": 3,
    "sub": "成功才關舊的"
   }
  ]
 },
 "強化 sshd_config 與防火牆#4": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5,
   6
  ],
  "head": [
   "設定",
   "值"
  ],
  "rows": [
   [
    "PermitRootLogin",
    "no"
   ],
   [
    "PasswordAuthentication",
    "no"
   ],
   [
    "PubkeyAuthentication",
    "yes"
   ],
   [
    "KbdInteractiveAuthentication",
    "no"
   ],
   [
    "AllowUsers",
    "deploy"
   ],
   [
    "MaxAuthTries",
    "3"
   ]
  ],
  "widths": [
   4,
   1
  ]
 },
 "強化 sshd_config 與防火牆#6": {
  "type": "flow",
  "reveal": [
   0,
   2,
   3,
   4,
   4,
   4
  ],
  "nodes": [
   {
    "label": "主檔設 no",
    "color": 0,
    "sub": "sshd_config"
   },
   {
    "label": "先讀 .d 目錄",
    "color": 1,
    "sub": "Include"
   },
   {
    "label": "cloud-init: yes",
    "color": 2,
    "sub": "第一個值生效"
   },
   {
    "label": "sshd -T",
    "color": 3,
    "sub": "看實際生效值"
   }
  ]
 },
 "強化 sshd_config 與防火牆#7": {
  "type": "table",
  "reveal": [
   1,
   2,
   3,
   4
  ],
  "head": [
   "項目",
   "指令或結果"
  ],
  "rows": [
   [
    "Ubuntu",
    "systemctl reload ssh"
   ],
   [
    "RHEL 系",
    "systemctl reload sshd"
   ],
   [
    "驗證",
    "ssh -o PubkeyAuthentication=no deploy@192.0.2.10"
   ],
   [
    "預期",
    "Permission denied (publickey)"
   ]
  ],
  "widths": [
   1,
   4
  ]
 }
}