{
 "Linux 網路基礎:位址、路由與 DNS 診斷#1": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ],
  "nodes": [
   {
    "label": "連結層",
    "sub": "網卡啟用?"
   },
   {
    "label": "IP 層",
    "sub": "位址與遮罩"
   },
   {
    "label": "路由",
    "sub": "預設閘道"
   },
   {
    "label": "外部連通",
    "sub": "已知外部 IP"
   },
   {
    "label": "DNS",
    "sub": "名稱解析"
   }
  ]
 },
 "Linux 網路基礎:位址、路由與 DNS 診斷#3": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "cards": [
   {
    "title": "192.168.1.50/24",
    "points": [
     "/24 = 前 24 位元是網路",
     "遮罩 255.255.255.0",
     "主機位址 1~254"
    ]
   },
   {
    "title": "default via",
    "points": [
     "預設閘道",
     "不在本網段的流量都送這裡",
     "沒有這行就連不到外網"
    ]
   },
   {
    "title": "lo",
    "points": [
     "迴路介面",
     "位址 127.0.0.1",
     "只用在本機內部"
    ]
   }
  ]
 },
 "Linux 網路基礎:位址、路由與 DNS 診斷#5": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "head": [
   "指令/輸出",
   "說明"
  ],
  "rows": [
   [
    "ip link",
    "連結層狀態 UP / DOWN"
   ],
   [
    "ip route",
    "顯示路由表"
   ],
   [
    "default via 192.168.1.1",
    "預設路由,DHCP 取得"
   ],
   [
    "192.168.1.0/24",
    "本機網段,直接送出"
   ]
  ],
  "widths": [
   2,
   3
  ]
 },
 "設定固定 IP:netplan 與 NetworkManager#2": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "nodes": [
   {
    "label": "主控台",
    "sub": "螢幕鍵盤/序列"
   },
   {
    "label": "備份設定",
    "sub": "先複製一份"
   },
   {
    "label": "netplan try",
    "sub": "自動回復"
   },
   {
    "label": "雲端主機",
    "sub": "勿輕易改靜態"
   }
  ]
 },
 "設定固定 IP:netplan 與 NetworkManager#3": {
  "type": "cards",
  "reveal": [
   1,
   2,
   4
  ],
  "cards": [
   {
    "title": "dhcp4",
    "points": [
     "先設成 false"
    ]
   },
   {
    "title": "addresses",
    "points": [
     "IP 加遮罩長度",
     "192.168.1.50/24"
    ]
   },
   {
    "title": "routes",
    "points": [
     "to: default",
     "via: 192.168.1.1"
    ]
   },
   {
    "title": "nameservers",
    "points": [
     "DNS 伺服器",
     "192.168.1.1, 192.168.1.2"
    ]
   }
  ]
 },
 "設定固定 IP:netplan 與 NetworkManager#5": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   2,
   3,
   4
  ],
  "nodes": [
   {
    "label": "備份",
    "sub": "cp -a"
   },
   {
    "label": "generate",
    "sub": "檢查語法"
   },
   {
    "label": "netplan try",
    "sub": "倒數 120 秒"
   },
   {
    "label": "apply",
    "sub": "正式套用"
   }
  ]
 },
 "設定固定 IP:netplan 與 NetworkManager#7": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "head": [
   "nmcli 指令",
   "用途"
  ],
  "rows": [
   [
    "device status",
    "看介面狀態"
   ],
   [
    "connection show",
    "列出連線設定檔"
   ],
   [
    "connection modify",
    "修改連線屬性"
   ],
   [
    "connection up",
    "重新啟用才生效"
   ]
  ],
  "widths": [
   2,
   3
  ]
 },
 "防火牆:ufw 與 firewalld#1": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2
  ],
  "cards": [
   {
    "title": "UFW",
    "points": [
     "Ubuntu / Debian",
     "友善的規則工具"
    ]
   },
   {
    "title": "firewalld",
    "points": [
     "Red Hat 系列",
     "用「區域」概念管理"
    ]
   }
  ]
 },
 "防火牆:ufw 與 firewalld#4": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "head": [
   "ufw 指令",
   "作用"
  ],
  "rows": [
   [
    "status verbose",
    "看狀態,預設 inactive"
   ],
   [
    "default deny incoming",
    "進站預設拒絕"
   ],
   [
    "default allow outgoing",
    "出站預設允許"
   ]
  ],
  "widths": [
   3,
   3
  ]
 },
 "防火牆:ufw 與 firewalld#5": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "nodes": [
   {
    "label": "22/tcp",
    "sub": "SSH,最先放行",
    "color": 1
   },
   {
    "label": "80/tcp",
    "sub": "網頁服務",
    "color": 0
   },
   {
    "label": "443/tcp",
    "sub": "加密網頁",
    "color": 0
   },
   {
    "label": "ufw enable",
    "sub": "規則加好才啟用",
    "color": 4,
    "kind": "end"
   }
  ]
 },
 "防火牆:ufw 與 firewalld#7": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "head": [
   "規則",
   "意思"
  ],
  "rows": [
   [
    "from 192.168.1.0/24 … port 22",
    "只讓該網段連 SSH"
   ],
   [
    "from 192.168.1.20 … port 5432",
    "只讓應用主機連資料庫"
   ],
   [
    "deny from 192.0.2.77",
    "封鎖特定來源"
   ]
  ],
  "widths": [
   3,
   3
  ]
 },
 "SSH 安全強化與別把自己鎖在門外#1": {
  "type": "cards",
  "reveal": [
   0,
   3
  ],
  "cards": [
   {
    "title": "停用密碼登入",
    "points": [
     "擋掉暴力猜密碼"
    ]
   },
   {
    "title": "改用金鑰",
    "points": [
     "公鑰放伺服器",
     "私鑰不外流"
    ]
   },
   {
    "title": "禁止 root",
    "points": [
     "不可直接登入"
    ]
   }
  ]
 },
 "SSH 安全強化與別把自己鎖在門外#2": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   0,
   1,
   2,
   3
  ],
  "nodes": [
   {
    "label": "ssh-keygen",
    "sub": "-t ed25519"
   },
   {
    "label": "ssh-copy-id",
    "sub": "公鑰到伺服器"
   },
   {
    "label": "ssh",
    "sub": "測試金鑰登入",
    "kind": "end"
   }
  ]
 },
 "SSH 安全強化與別把自己鎖在門外#4": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "head": [
   "設定",
   "值"
  ],
  "rows": [
   [
    "PermitRootLogin",
    "no"
   ],
   [
    "PasswordAuthentication",
    "no"
   ],
   [
    "PubkeyAuthentication",
    "yes"
   ],
   [
    "AllowUsers",
    "alice bob"
   ]
  ],
  "widths": [
   3,
   2
  ]
 },
 "SSH 安全強化與別把自己鎖在門外#6": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ],
  "nodes": [
   {
    "label": "保留舊視窗",
    "sub": "安全網"
   },
   {
    "label": "備份設定",
    "sub": "cp -a"
   },
   {
    "label": "sshd -t",
    "sub": "無輸出才對"
   },
   {
    "label": "reload",
    "sub": "不是 restart"
   },
   {
    "label": "新視窗測試",
    "sub": "金鑰登入"
   }
  ]
 }
}