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

3
config
View File

@@ -12,8 +12,6 @@ Host github.com
# --- Global Settings ---
Host *
# StrictHostKeyChecking no # 不進行 Strict HostKey 檢查
# UserKnownHostsFile /dev/null # 不使用 KnownHosts 檔案
# —— 連線穩定與正常結束 ——
TCPKeepAlive yes # 啟用 TCP KeepAlive 功能
ServerAliveInterval 60 # 每 60 秒向伺服器端發送一次請求
@@ -36,4 +34,3 @@ Host *
CheckHostIP no # 不檢查 IP 位址是否變更
VisualHostKey no # 不顯示伺服器端的 HostKey

View File

@@ -49,10 +49,10 @@ Host 140.136.202.209
Host 34.80.116.132
HostName 34.80.116.132
IdentityFile /Users/timmy/.ssh/google_compute_engine
UserKnownHostsFile=/Users/timmy/.ssh/google_compute_known_hosts
# HostKeyAlias=compute.97799509408430482
IdentitiesOnly=yes
CheckHostIP=no
UserKnownHostsFile /Users/timmy/.ssh/google_compute_known_hosts
# HostKeyAlias compute.97799509408430482
IdentitiesOnly yes
CheckHostIP no
# Fu Jen Dev Server (輔大)
Host fju_dev

View File

@@ -6,64 +6,32 @@ Host ma_fw
HostName 192.168.88.1
User ubuntu
Host 192.168.88.2
User root
Host 192.168.88.99
User ubuntu
Host 192.168.88.4 192.168.88.4.nip.io
User pi
Host 192.168.88.10
User timmy
# MA 內網主機 (root)
Host 192.168.88.2
User root
Host 192.168.88.11
User timmy
Host 192.168.88.12
User timmy
Host 192.168.88.13
User timmy # 預設使用者:連線時自動使用 timmy 帳號登入
Host 192.168.88.15
User ubuntu
Host 192.168.88.16
# MA 內網主機 (timmy)
Host 192.168.88.10 192.168.88.11 192.168.88.12 192.168.88.13 192.168.88.16 192.168.88.33
User timmy
Host 192.168.88.18
User timmy
LocalForward 50041 127.0.0.1:80
Host 192.168.88.19
# MA 內網主機 (ubuntu)
Host 192.168.88.15 192.168.88.19 192.168.88.30 192.168.88.31 192.168.88.32 192.168.88.99 192.168.88.181 192.168.88.193 192.168.88.194
User ubuntu
Host 192.168.88.30
User ubuntu
Host 192.168.88.31
User ubuntu
Host 192.168.88.173
User ubuntu
Host 192.168.88.32
User ubuntu
Port 22
Host 192.168.88.33
User timmy
# Mail Server MA (內網連線)
Host mail_ma_local 192.168.88.35
HostName 192.168.88.35
User timmy
LocalForward 16361 127.0.0.1:80 # Mail 管理介面
HostKeyAlgorithms +ssh-rsa # 支援舊版加密
PubkeyAcceptedKeyTypes +ssh-rsa # 支援舊版金鑰
LocalForward 16361 127.0.0.1:80
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
# --- Timmy Personal Dev ---
@@ -99,54 +67,32 @@ Host ma_mediawiki
HostName 192.168.88.173
User ubuntu
Host 192.168.88.181
User ubuntu
# --- MA 虛擬化主機 ---
Host 192.168.88.193
User ubuntu
HostName 192.168.88.193
Host 192.168.88.194
User ubuntu
HostName 192.168.88.194
# This is VMware ESXi 6.0.0 Update 2 with the main firewall for MA on the 11th floor of Oriental Science Park (internal IP 192.168.88.1) and the firewall for implementing IPv6 (internal IP 192.168.88.150).
# VMware ESXi 6.0.0 (11F 防火牆 + IPv6 防火牆)
Host 192.168.88.241
User root
HostKeyAlgorithms +ssh-rsa
# This is the MA VMware ESXi 6.7.0 Update 1 server with a mail server, along with the firewall for the 5th floor of Oriental Science Park and a dedicated firewall for the mail server.
# VMware ESXi 6.7.0 (郵件伺服器 + 5F 防火牆)
Host 192.168.88.248
User root
# This is the MA PVE server.
Host 192.168.88.247
# PVE 伺服器
Host 192.168.88.247 192.168.88.249 192.168.88.73
User root
# This is the MA PVE server.
Host 192.168.88.249
User root
# This is the MA PVE server.
Host 192.168.88.73
User root
# This is the firewall for MA on the 5th floor of Oriental Science Park.
# 5F 防火牆 (東方科學園區)
Host 192.168.3.88
User apple
ProxyJump 211.23.141.208
Ciphers aes256-cbc,aes256-ctr
# This is the firewall for MA on the 11th floor of Oriental Science Park.
# 11F 防火牆 (東方科學園區)
Host 211.23.141.208
User ubuntu
# This is the firewall for MA on the 11th floor of Oriental Science Park.
# Host 211.23.141.207
# User timmy
# This is the Ubuntu Server for the Serbia office.
# Serbia 辦公室
Host 89.216.107.241 serbia-office
HostName 89.216.107.241
User timmy

View File

@@ -1,63 +1,22 @@
Host timmy_home_server
User timmy
HostName 125.229.110.50
Ciphers aes256-cbc,aes256-ctr # Encryption algorithms for better security
Ciphers aes256-cbc,aes256-ctr
Host 141.11.93.252
User root
HostName 141.11.93.252
Ciphers aes256-cbc,aes256-ctr # Encryption algorithms for better security
Ciphers aes256-cbc,aes256-ctr
Host 192.168.42.123
# 內網主機 (root)
Host 192.168.42.10 192.168.42.38 192.168.42.39 192.168.42.40 192.168.42.101 192.168.42.102 192.168.42.106 192.168.42.112 192.168.42.118 192.168.42.123 192.168.42.124 192.168.42.126 192.168.42.211
User root
Host 192.168.42.10
User root
Host 192.168.42.38
User root
Host 192.168.42.39
User root
Host 192.168.42.40
User root
Host 192.168.42.101
User root
Host 192.168.42.102
User root
Host 192.168.42.112
User root
Host 192.168.42.106
User root
Host 192.168.42.120
# 內網主機 (ubuntu)
Host 192.168.42.120 192.168.42.121 192.168.42.122
User ubuntu
Host 192.168.42.121
User ubuntu
Host 192.168.42.122
User ubuntu
Host 192.168.42.211
User root
Host 192.168.42.118
User root
Host 192.168.42.124
User root
Host 192.168.42.126
User root
# Termux (Android)
Host 100.64.0.9
Port 8022
User u0_a291

View File

@@ -14,9 +14,9 @@ export LANGUAGE=en_US:en
eval $(ssh-agent)
# 將指定路徑的 SSH 私鑰加入到 SSH-Agent 中
# ssh-add ~/Sync/.ssh/
ssh-add ~/Sync/.ssh/aws_server_13_113_205_237.pem
ssh-add ~/Sync/.ssh/aws_server_18_177_222_167.pem
BASE_DIR="$HOME/Library/Mobile Documents/com~apple~CloudDocs/.ssh"
ssh-add "$BASE_DIR/aws_server_13_113_205_237.pem"
ssh-add "$BASE_DIR/aws_server_18_177_222_167.pem"
# 列出已經加入到 SSH-Agent 中的金鑰清單
ssh-add -l