Consolidate SSH config: merge duplicate hosts, fix paths and formatting

- Merge same-user hosts into grouped Host entries (timmy, ma)
- Fix ssh_key_management.sh path from ~/Sync to iCloud
- Standardize = syntax to space-separated (jason_hsieh)
- Unify indentation to 4 spaces (config)
- Remove duplicate 192.168.88.173 entry and redundant HostNames

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-09 13:11:56 +08:00
parent e9808800a9
commit e94f23d82e
5 changed files with 83 additions and 181 deletions

45
config
View File

@@ -3,37 +3,34 @@ Include config.d/*
# Fig ssh integration. Keep at the bottom of this file.
Match all
Include ~/.fig/ssh
Include ~/.fig/ssh
Host github.com
IdentityFile ~/.ssh/id_rsa
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
AddKeysToAgent yes
# --- Global Settings ---
Host *
# StrictHostKeyChecking no # 不進行 Strict HostKey 檢查
# UserKnownHostsFile /dev/null # 不使用 KnownHosts 檔案
# —— 連線穩定與正常結束 ——
TCPKeepAlive yes # 啟用 TCP KeepAlive 功能
ServerAliveInterval 60 # 每 60 秒向伺服器端發送一次請求
ServerAliveCountMax 5 # 若伺服器端 5 次無回應則中斷連接
ExitOnForwardFailure yes # 若連線轉發失敗立即退出,避免殘留 session
# —— 連線穩定與正常結束 ——
TCPKeepAlive yes # 啟用 TCP KeepAlive 功能
ServerAliveInterval 60 # 每 60 秒向伺服器端發送一次請求
ServerAliveCountMax 5 # 若伺服器端 5 次無回應則中斷連接
ExitOnForwardFailure yes # 若連線轉發失敗立即退出,避免殘留 session
# —— Multiplexing加速多連線減少殘留程序——
ControlMaster auto # 自動使用 ControlMaster 功能
ControlPath ~/.ssh/sockets/%r@%h-%p # 設定 ControlPath
ControlPersist 5m # 主連線關掉後socket 最多保留 5 分鐘
# —— Multiplexing加速多連線減少殘留程序——
ControlMaster auto # 自動使用 ControlMaster 功能
ControlPath ~/.ssh/sockets/%r@%h-%p # 設定 ControlPath
ControlPersist 5m # 主連線關掉後socket 最多保留 5 分鐘
# —— 安全性建議(擇一)——
# 預設:保留嚴格檢查(建議)
#StrictHostKeyChecking ask
# 或想少互動但仍相對安全:
#StrictHostKeyChecking accept-new
# —— 安全性建議(擇一)——
# 預設:保留嚴格檢查(建議)
#StrictHostKeyChecking ask
# 或想少互動但仍相對安全:
#StrictHostKeyChecking accept-new
# —— 代理/金鑰(依你目前環境)——
IdentityAgent /Users/timmy/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh
CheckHostIP no # 不檢查 IP 位址是否變更
VisualHostKey no # 不顯示伺服器端的 HostKey
# —— 代理/金鑰(依你目前環境)——
IdentityAgent /Users/timmy/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh
CheckHostIP no # 不檢查 IP 位址是否變更
VisualHostKey no # 不顯示伺服器端的 HostKey