У меня стандартная настройка:
Клиент (Windows 2019) --> HTTP-прокси --> SSH-сервер (Ubuntu) --> Сервер
Я хочу перенаправить свой локальный порт на сервер.
Я могу успешно подключиться с клиента, используя эту настройку к серверу. Я не указал ничего, связанного с прокси в моем вызове
ssh -v -p 22 -N -C -L 50000:WinServer:8080 user@SSHServer
Я думаю, это означает, что реализация OpenSSH подбирает настройки прокси по умолчанию из клиентской системы. Я хочу явно указать прокси, чтобы изолировать свое решение от настроек клиентской машины.
Я попробовал опцию ProxyCommand следующим образом:
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
Мои ограничения:
- Я не могу ничего изменить на прокси. Действительно, мое решение будет развернуто у разных клиентов, поэтому я не должен предполагать ничего, кроме HTTP-прокси.
- У меня ограниченные возможности добавлять/изменять программное обеспечение на клиенте. Я бы хотел использовать функцию Microsoft по умолчанию, если это возможно. Любое стороннее программное обеспечение должно быть квалифицировано, и это больно.
Любые рекомендации будут высоко оценены.
Спасибо,