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:
3
config
3
config
@@ -12,8 +12,6 @@ Host github.com
|
|||||||
# --- Global Settings ---
|
# --- Global Settings ---
|
||||||
Host *
|
Host *
|
||||||
|
|
||||||
# StrictHostKeyChecking no # 不進行 Strict HostKey 檢查
|
|
||||||
# UserKnownHostsFile /dev/null # 不使用 KnownHosts 檔案
|
|
||||||
# —— 連線穩定與正常結束 ——
|
# —— 連線穩定與正常結束 ——
|
||||||
TCPKeepAlive yes # 啟用 TCP KeepAlive 功能
|
TCPKeepAlive yes # 啟用 TCP KeepAlive 功能
|
||||||
ServerAliveInterval 60 # 每 60 秒向伺服器端發送一次請求
|
ServerAliveInterval 60 # 每 60 秒向伺服器端發送一次請求
|
||||||
@@ -36,4 +34,3 @@ Host *
|
|||||||
|
|
||||||
CheckHostIP no # 不檢查 IP 位址是否變更
|
CheckHostIP no # 不檢查 IP 位址是否變更
|
||||||
VisualHostKey no # 不顯示伺服器端的 HostKey
|
VisualHostKey no # 不顯示伺服器端的 HostKey
|
||||||
|
|
||||||
|
|||||||
@@ -49,10 +49,10 @@ Host 140.136.202.209
|
|||||||
Host 34.80.116.132
|
Host 34.80.116.132
|
||||||
HostName 34.80.116.132
|
HostName 34.80.116.132
|
||||||
IdentityFile /Users/timmy/.ssh/google_compute_engine
|
IdentityFile /Users/timmy/.ssh/google_compute_engine
|
||||||
UserKnownHostsFile=/Users/timmy/.ssh/google_compute_known_hosts
|
UserKnownHostsFile /Users/timmy/.ssh/google_compute_known_hosts
|
||||||
# HostKeyAlias=compute.97799509408430482
|
# HostKeyAlias compute.97799509408430482
|
||||||
IdentitiesOnly=yes
|
IdentitiesOnly yes
|
||||||
CheckHostIP=no
|
CheckHostIP no
|
||||||
|
|
||||||
# Fu Jen Dev Server (輔大)
|
# Fu Jen Dev Server (輔大)
|
||||||
Host fju_dev
|
Host fju_dev
|
||||||
|
|||||||
90
config.d/ma
90
config.d/ma
@@ -6,64 +6,32 @@ Host ma_fw
|
|||||||
HostName 192.168.88.1
|
HostName 192.168.88.1
|
||||||
User ubuntu
|
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
|
Host 192.168.88.4 192.168.88.4.nip.io
|
||||||
User pi
|
User pi
|
||||||
|
|
||||||
Host 192.168.88.10
|
# MA 內網主機 (root)
|
||||||
User timmy
|
Host 192.168.88.2
|
||||||
|
User root
|
||||||
|
|
||||||
Host 192.168.88.11
|
# MA 內網主機 (timmy)
|
||||||
User 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
|
||||||
|
|
||||||
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
|
|
||||||
User timmy
|
User timmy
|
||||||
|
|
||||||
Host 192.168.88.18
|
Host 192.168.88.18
|
||||||
User timmy
|
User timmy
|
||||||
LocalForward 50041 127.0.0.1:80
|
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
|
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 (內網連線)
|
# Mail Server MA (內網連線)
|
||||||
Host mail_ma_local 192.168.88.35
|
Host mail_ma_local 192.168.88.35
|
||||||
HostName 192.168.88.35
|
HostName 192.168.88.35
|
||||||
User timmy
|
User timmy
|
||||||
LocalForward 16361 127.0.0.1:80 # Mail 管理介面
|
LocalForward 16361 127.0.0.1:80
|
||||||
HostKeyAlgorithms +ssh-rsa # 支援舊版加密
|
HostKeyAlgorithms +ssh-rsa
|
||||||
PubkeyAcceptedKeyTypes +ssh-rsa # 支援舊版金鑰
|
PubkeyAcceptedKeyTypes +ssh-rsa
|
||||||
|
|
||||||
# --- Timmy Personal Dev ---
|
# --- Timmy Personal Dev ---
|
||||||
|
|
||||||
@@ -99,54 +67,32 @@ Host ma_mediawiki
|
|||||||
HostName 192.168.88.173
|
HostName 192.168.88.173
|
||||||
User ubuntu
|
User ubuntu
|
||||||
|
|
||||||
Host 192.168.88.181
|
# --- MA 虛擬化主機 ---
|
||||||
User ubuntu
|
|
||||||
|
|
||||||
Host 192.168.88.193
|
# VMware ESXi 6.0.0 (11F 防火牆 + IPv6 防火牆)
|
||||||
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).
|
|
||||||
Host 192.168.88.241
|
Host 192.168.88.241
|
||||||
User root
|
User root
|
||||||
HostKeyAlgorithms +ssh-rsa
|
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
|
Host 192.168.88.248
|
||||||
User root
|
User root
|
||||||
|
|
||||||
# This is the MA PVE server.
|
# PVE 伺服器
|
||||||
Host 192.168.88.247
|
Host 192.168.88.247 192.168.88.249 192.168.88.73
|
||||||
User root
|
User root
|
||||||
|
|
||||||
# This is the MA PVE server.
|
# 5F 防火牆 (東方科學園區)
|
||||||
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.
|
|
||||||
Host 192.168.3.88
|
Host 192.168.3.88
|
||||||
User apple
|
User apple
|
||||||
ProxyJump 211.23.141.208
|
ProxyJump 211.23.141.208
|
||||||
Ciphers aes256-cbc,aes256-ctr
|
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
|
Host 211.23.141.208
|
||||||
User ubuntu
|
User ubuntu
|
||||||
|
|
||||||
# This is the firewall for MA on the 11th floor of Oriental Science Park.
|
# Serbia 辦公室
|
||||||
# Host 211.23.141.207
|
|
||||||
# User timmy
|
|
||||||
|
|
||||||
# This is the Ubuntu Server for the Serbia office.
|
|
||||||
Host 89.216.107.241 serbia-office
|
Host 89.216.107.241 serbia-office
|
||||||
HostName 89.216.107.241
|
HostName 89.216.107.241
|
||||||
User timmy
|
User timmy
|
||||||
|
|||||||
@@ -1,63 +1,22 @@
|
|||||||
Host timmy_home_server
|
Host timmy_home_server
|
||||||
User timmy
|
User timmy
|
||||||
HostName 125.229.110.50
|
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
|
Host 141.11.93.252
|
||||||
User root
|
User root
|
||||||
HostName 141.11.93.252
|
HostName 141.11.93.252
|
||||||
Ciphers aes256-cbc,aes256-ctr # Encryption algorithms for better security
|
Ciphers aes256-cbc,aes256-ctr
|
||||||
|
|
||||||
|
# 內網主機 (root)
|
||||||
Host 192.168.42.123
|
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
|
User root
|
||||||
|
|
||||||
Host 192.168.42.10
|
# 內網主機 (ubuntu)
|
||||||
User root
|
Host 192.168.42.120 192.168.42.121 192.168.42.122
|
||||||
|
|
||||||
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
|
|
||||||
User ubuntu
|
User ubuntu
|
||||||
|
|
||||||
Host 192.168.42.121
|
# Termux (Android)
|
||||||
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
|
|
||||||
|
|
||||||
Host 100.64.0.9
|
Host 100.64.0.9
|
||||||
Port 8022
|
Port 8022
|
||||||
User u0_a291
|
User u0_a291
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ export LANGUAGE=en_US:en
|
|||||||
eval $(ssh-agent)
|
eval $(ssh-agent)
|
||||||
|
|
||||||
# 將指定路徑的 SSH 私鑰加入到 SSH-Agent 中
|
# 將指定路徑的 SSH 私鑰加入到 SSH-Agent 中
|
||||||
# ssh-add ~/Sync/.ssh/
|
BASE_DIR="$HOME/Library/Mobile Documents/com~apple~CloudDocs/.ssh"
|
||||||
ssh-add ~/Sync/.ssh/aws_server_13_113_205_237.pem
|
ssh-add "$BASE_DIR/aws_server_13_113_205_237.pem"
|
||||||
ssh-add ~/Sync/.ssh/aws_server_18_177_222_167.pem
|
ssh-add "$BASE_DIR/aws_server_18_177_222_167.pem"
|
||||||
|
|
||||||
# 列出已經加入到 SSH-Agent 中的金鑰清單
|
# 列出已經加入到 SSH-Agent 中的金鑰清單
|
||||||
ssh-add -l
|
ssh-add -l
|
||||||
|
|||||||
Reference in New Issue
Block a user