# 📌 Туннелирование SSH через HTTP **************************************************************************************************** Исходники тут: https://github.com/larsbrinkhoff/httptunnel: ```sh sudo apt-get install httptunnel ```` Настроил HAProxy примерно так, чтобы проверялся параметр "mybiglogfile" для редиректа: ``` frontend frontend-http bind *:80 mode http acl v_tunnel url_param(mybiglogfile) -m found use_backend httptunnel_backend if v_tunnel http-request redirect scheme https code 301 unless { ssl_fc } || v_tunnel ``` Проверить нет ли редирект можно так: curl -I http://192.168.200.81/index.html?mybiglogfile=all curl -I http://locust.kz/index.html?mybiglogfile=all На сервере запустил прослушку на 9999 и перенаправление на 22: ```sh sudo hts -F 127.0.0.1:22 9999 ```` Для остановки ```sh ps aux | grep hts sudo kill 1854 ``` Можно запустить как сервис так sudo mcedit /etc/systemd/system/httptunnel.service: ``` [Unit] Description=HTTP Tunnel Service After=network.target [Service] ExecStart=hts -F 127.0.0.1:22 9999 Restart=always User=root RestartSec=10 [Install] WantedBy=multi-user.target ``` Потом: ```sh sudo systemctl daemon-reload sudo systemctl enable httptunnel sudo systemctl stop httptunnel sudo systemctl start httptunnel sudo systemctl status httptunnel tail -f /var/log/syslog | grep --line-buffered "htc" ``` На клиенте запускаем локальный порт также указал 9999 а ключь ```sh htc -F 9999 --base-uri /index.html?mybiglogfile=all 192.168.200.81:80 htc -F 9999 --base-uri /index.html?mybiglogfile=all locust.kz:80 ``` Для остановки ```sh ps aux | grep htc Потом sudo kill 783 ``` Пробую подключиться после настройки тунеля: ```sh ssh igor@127.0.0.1 -p 9999 ```