![使用堡壘設定檔進行伺服器配置](https://rvso.com/image/782592/%E4%BD%BF%E7%94%A8%E5%A0%A1%E5%A3%98%E8%A8%AD%E5%AE%9A%E6%AA%94%E9%80%B2%E8%A1%8C%E4%BC%BA%E6%9C%8D%E5%99%A8%E9%85%8D%E7%BD%AE.png)
我正在為我們的幾個開發人員設置跳轉伺服器/堡壘主機,並想知道是否可以config
在堡壘最終伺服器解析。
例如我們有
- 開發商
- 堡壘
- 客戶
目前,我在開發人員中有以下內容.ssh/config
Host bastion
HostName bastion-address.com
User developer
Host client
User client-user
HostName client-ip
ProxyJump bastion
然而,如果我可以在堡壘上設定客戶端用戶和 IP,那就太好了。這樣,開發人員不需要知道詳細信息,只需知道Host
要連接的名稱即可。
因此,可以想像在開發人員筆記型電腦上出現類似以下內容:
Host bastion
HostName bastion-address.com
User developer
Host client-server
HostName client-name
ProxyJump bastion
然後是堡壘上的:
Host client-name
User client-user
HostName client-ip
希望這是有道理的。
答案1
使用 DNS。
使用相關 IP 為 bastion.example.net、client.example.net 等建立 AAAA 記錄。
刪除 ssh_config 中的 IP 位址。