Ssh

OpenVPN - 使用 OpenSSH 進行埠共享

  • April 27, 2020

是否可以使用 OpenVPN 的 share-port 選項在 OpenVPN (2.2.1) 和 OpenSSH (5.3) 守護程序之間共享相同的埠和 ip?

我無法讓它工作..我在所有介面上監聽到埠 22 的 openssh ,以及在埠 443 上使用 TCP 協議的 openvpn 守護程序。我添加了:

port-share 127.0.0.1 22

到啟動該特定 openvpn 守護程序並重新啟動它的 conf 文件 - 它啟動時沒有錯誤。但是,當我嘗試從網路中的其他地方 ssh 進入該 ip 和埠時,它會停止:

ssh -v -p443 user@host
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Applying options for *
debug1: Connecting to host [123.123.123.123] port 443.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.ssh/id_dsa type 2
debug1: loaded 3 keys

有什麼我想念的嗎?顯然,該埠已暢通,openvpn 繼續在該埠上工作。我在搜尋中找不到 OpenVPN + OpenSSH 埠共享的工作範例,有人可以幫忙嗎?

我看到的手冊頁說這僅適用於 http/https。除非你找到了更新檔或我不知道的東西?

男人 OpenVPN

–埠共享

在 TCP 伺服器模式下執行時,與其他應用程序共享 OpenVPN 埠,例如 HTTPS 伺服器。如果 OpenVPN 檢測到與其使用非 OpenVPN 協議的埠的連接,它將代理連接到 host:port 上的伺服器。 目前僅設計用於 HTTP/HTTPS,儘管理論上可以擴展到其他協議,例如 ssh。

未在 Windows 上實現。

引用自:https://serverfault.com/questions/346307