tech.gate.io blog

ssh over http proxy

you need to be able to configure iptables or the sshd port on the ssh-server, in order to make this work

 

on the ssh-server:

 

unclean method:

change sshd port to 443

edit sshd_config (/etc/ssh/sshd_config) in most cases

replace Port 22 with Port 443

restart sshd

clean method:

 
check out your proxys external ip(s)

configure your browser to use your proxy

surf to http://www.whatsmyip.com.au/

repeat this after a period of time, since most companies use 2 or more external ips, switching round robin

 
now install iptables, if not already installed

run

EXTERNALIP1=xxx.xxx.xxx.xxx
EXTERNALIP2=xxx.xxx.xxx.xxx

iptables -t nat -A PREROUTING -s $EXTERNALIP1 -p tcp --dport 443 -j REDIRECT --to-port 22

iptables -t nat -A PREROUTING -s $EXTERNALIP2 -p tcp --dport 443 -j REDIRECT --to-port 22

now every attempt from externalip1/2 to port 443 on the ssh-server, ends up in port 22, where our sshd runs

 

Client configuration:

 

Windows:

for Windows use putty
just goto proxy section, choose http-proxy and enter your authentication data in the fields below
then switch to session, and put port 443 in the field next to the servers hostname

Linux:

since putty is available for linux too, the way should be the same, but for me, I want to use openssh from the kde konsole

found this tutorial:

http://www.zeitoun.net/articles/ssh-through-http-proxy/start

in short:

yum install connect-proxy

add to ~/.ssh/config:

## Outside of the firewall, with HTTPS proxy
Host my-ssh-server-host.net
  ProxyCommand connect -H proxy.free.fr:3128 %h 443
## Inside the firewall (do not use proxy)
Host *
   ProxyCommand connect %h %p

now test:

ssh my-ssh-server-host.net

 
takes a while in my case, but then login appears, working fine

 


8 comments


private message
Whoa, whoa, get out the way with that good inofmtraion.



private message
Yg32QC gdbjeqfgvpwf



private message
viagra %-P viagra 21361



private message
koop viagra online zonder recept 964219 Viagra en línea }:(((



private message
order viagra 609453 cialis 828


Page: 1/2  [Next]
1  2 

Post new comment

Anti-Bot verification code image
Try another code

Feeds List