OpenSSH für Windows über HTTP-Proxy

OpenSSH für Windows über HTTP-Proxy

Ich habe ein Standard-Setup:

Client (Windows 2019) --> HTTP-Proxy --> SSH-Server (Ubuntu) --> Server

Ich möchte meinen lokalen Port an den Server weiterleiten.

Ich kann mit diesem Setup erfolgreich eine Verbindung vom Client zum Server herstellen. Ich habe in meinem Anruf nichts im Zusammenhang mit dem Proxy angegeben.

ssh -v -p 22 -N -C -L 50000:WinServer:8080 user@SSHServer

Ich denke, das bedeutet, dass die OpenSSH-Implementierung die Standard-Proxy-Einstellungen vom Client-System übernimmt. Ich möchte den Proxy explizit angeben, damit ich meine Lösung vom Setup des Client-Rechners isolieren kann.

Ich habe die ProxyCommand-Option wie folgt ausprobiert:

PS C:\scripts> ssh.exe -vvv -C -L 50000:WinServer:8080 -o ProxyCommand="ssh.exe -v -W %h:%p -p proxy-port proxy-host" user@SSHServer

OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug3: Failed to open file:C:/Users/Administrator/.ssh/config error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug1: Executing proxy command: exec ssh.exe -v -W SSHServer:22 -p proxy-port proxy-host
debug3: spawning "C:\\Windows\\System32\\OpenSSH\\ssh.exe" -v -W SSHServer:22 -p proxy-port proxy-host
debug3: w32_getpeername ERROR: not sock :2
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5  

debug3: Failed to open file:C:/Users/Administrator/.ssh/id_rsa error:2
debug1: Connecting to proxy-host [proxy-host] port proxy-port.
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_rsa.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Administrator/.ssh/id_rsa type -1
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_rsa-cert error:2
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_rsa-cert.pub error:2  

debug1: Connection established.  

debug1: key_load_public: No such file or directory
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Administrator/.ssh/id_rsa-cert type -1
debug1: identity file C:\\Users\\Administrator/.ssh/id_rsa type -1
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_dsa error:2
debug1: key_load_public: No such file or directory
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_dsa.pub error:2
debug1: identity file C:\\Users\\Administrator/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Administrator/.ssh/id_dsa type -1
debug1: identity file C:\\Users\\Administrator/.ssh/id_dsa type -1
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_dsa-cert error:2
debug1: key_load_public: No such file or directory
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_dsa-cert.pub error:2
debug1: identity file C:\\Users\\Administrator/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Administrator/.ssh/id_dsa-cert type -1
debug1: identity file C:\\Users\\Administrator/.ssh/id_ecdsa type -1
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_ecdsa error:2
debug1: key_load_public: No such file or directory
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_ecdsa.pub error:2
debug1: identity file C:\\Users\\Administrator/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Administrator/.ssh/id_ecdsa type -1
debug1: identity file C:\\Users\\Administrator/.ssh/id_ed25519 type -1
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_ecdsa-cert error:2
debug1: key_load_public: No such file or directory
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_ecdsa-cert.pub error:2
debug1: identity file C:\\Users\\Administrator/.ssh/id_ed25519-cert type -1
debug1: key_load_public: No such file or directory
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Administrator/.ssh/id_ecdsa-cert type -1
debug1: identity file C:\\Users\\Administrator/.ssh/id_xmss type -1
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_ed25519 error:2
debug1: key_load_public: No such file or directory
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_ed25519.pub error:2
debug1: identity file C:\\Users\\Administrator/.ssh/id_xmss-cert type -1
debug1: key_load_public: No such file or directory
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
debug1: identity file C:\\Users\\Administrator/.ssh/id_ed25519 type -1
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_ed25519-cert error:2
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_ed25519-cert.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Administrator/.ssh/id_ed25519-cert type -1
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_xmss error:2
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_xmss.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Administrator/.ssh/id_xmss type -1
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_xmss-cert error:2
debug3: Failed to open file:C:/Users/Administrator/.ssh/id_xmss-cert.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Administrator/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7  

ssh_exchange_identification: Connection closed by remote host

Meine Einschränkungen:

  1. Am Proxy kann ich nichts ändern. Da meine Lösung bei verschiedenen Kunden eingesetzt wird, kann ich nichts anderes als einen HTTP-Proxy annehmen.
  2. Ich habe nur begrenzte Möglichkeiten, Software auf dem Client hinzuzufügen/zu ändern. Ich würde, wenn möglich, gerne die Standardfunktion von Microsoft verwenden. Jede Drittanbietersoftware müsste qualifiziert werden, und das ist mühsam.

Ich wäre für jede Anleitung sehr dankbar.

Danke,

verwandte Informationen