SSH sobre HTTPS via CONNECT Proxy

Proxy: sshproxy.app.guiliano.com.br:443 · Autenticação: ativada · TLS interno: desativado

1. Teste rápido

curl http://sshproxy.app.guiliano.com.br/healthz

Resposta esperada: ok

2. Linux/macOS usando o cliente Python incluído

Baixe o cliente:

curl -o ssh_https_connect.py http://sshproxy.app.guiliano.com.br/download
chmod +x ssh_https_connect.py

Conecte via SSH:

ssh -o ProxyCommand='./ssh_https_connect.py --proxy-host sshproxy.app.guiliano.com.br --proxy-port 443 --proxy-user server --target-host %h --target-port %p --insecure' usuario@seu-servidor-interno.com

3. Arquivo ~/.ssh/config

Host destino-via-https
  HostName seu-servidor-interno.com
  User usuario
  Port 22
  ProxyCommand /caminho/ssh_https_connect.py --proxy-host sshproxy.app.guiliano.com.br --proxy-port 443 --proxy-user server --target-host %h --target-port %p --insecure

Depois use:

ssh destino-via-https

4. Windows / PuTTY

PuTTY nem sempre encapsula proxy HTTP em TLS diretamente. A forma mais confiável é usar o cliente Python local como comando de proxy.

  1. Instale Python no Windows.
  2. Baixe ssh_https_connect.py.
  3. No PuTTY, vá em Connection → Proxy.
  4. Em Proxy type, selecione Local.
  5. Em Telnet command, or local proxy command, use:
python C:\caminho\ssh_https_connect.py --proxy-host sshproxy.app.guiliano.com.br --proxy-port 443 --proxy-user server --target-host %host --target-port %port --insecure

5. Segurança

Use senha forte em PROXY_PASS. Para produção, prefira terminar TLS no domínio publicado pela VPS/reverse proxy e usar TLS_ENABLED=false no container.