DIGIT-ARC read-only archive · snapshot: July 23, 2026

SSH via HTTP Proxy

18 posts · originally from https://geek.digit.in/community/threads/ssh-via-http-proxy.52130/

desertwind
desertwind Original post #1
Mar 12, 2007 at 10:56 AM
I need to access ssh via an http proxy. We use an automatic proxy configuration url (pac file) for browsers. Any idea how to use it for ssh?
kalpik
kalpik #2
Mar 12, 2007 at 1:39 PM
AFAIK, HTTP proxy is only for port 80.. You cannot access SSH through it..
desertwind
Mar 12, 2007 at 2:06 PM
I can. That is what port tunnelling is for.

But my problem is, here i don't have the proxy address and port, what i have is a pac (proxy automatic config file). I don't know how to tackle it.
nileshgr
Mar 12, 2007 at 2:10 PM
IE proxy url configuration: *localhost:port/proxy.pac or something similar.
desertwind
Mar 12, 2007 at 2:27 PM
I need to configure ssh using a pac file.

And what is IE doing in middle. Did i mentioned it somewhere ?
kalpik
kalpik #6
Mar 12, 2007 at 3:01 PM
Hmm.. I'd like to know more about port tunneling! Please temme when you have time :)
mediator
Mar 12, 2007 at 3:01 PM
I have forgoten about port tunneling, but there r certain sites that allow u to have shell window in the browser. So if u visit such sites via proxy, then may be u can get ssh there!
desertwind
Mar 12, 2007 at 3:14 PM
@kalpik: not a problem. But you can google for more details. I'm not that an expert in it.

Now my scenario is something like this.

My company have a corporate firewall which blocks all ports other than 80 (http)
I want to use ssh which uses port 22, and for the same reason i cannot.
So what i need to do is to tell ssh to go through the http proxy (using port 80). This is easy if i have a proxy address, a username and a password. But my company is using a pac file for automatic proxy configuration. I don't know how to use this with ssh.

Any clues?
FatBeing
Mar 12, 2007 at 4:33 PM
Try downloading the pac by entering its URL in a browser window. Open it in Notepad, and you should get all your server and port details.
uchiha.sasuke
Mar 12, 2007 at 6:52 PM
@desertwind ............m also behind proxy ....i know proxy address and have user name & password also.....so can u plz tell me how to do it......wat r d possibilities of using SSH?????
desertwind
Mar 12, 2007 at 7:04 PM
Thanks a lot Fatbeing for pointing that out.

@uchiha.sasuke

1. install corkscrew

2. Edit .ssh/config file in your home folder and add the following line

Code:
Host *
  ProxyCommand corkscrew http-proxy.example.com 8080 %h %p auth_file
Replace http-proxy.example.com with your actual proxy and 8080 with port.

3. create a file auth_file and put in your username and password to proxy as follows
Code:
username:password

Thats it.
Sykora
Sykora #12
Mar 12, 2007 at 7:05 PM
Are you trying to set up a host or client? ssh listens on port 22, so the host should be able to use it. I've accessed a friend's computer outside my residential gateway when I can't use port 22 but he can, so he was host. It should be possible to change this as well, but I haven't found out how yet. So are you server or client?
desertwind
Mar 12, 2007 at 7:08 PM
I'm a client trying to access some other server through ssh.
uchiha.sasuke
Mar 12, 2007 at 7:40 PM
first of all thanx for ur quick response......


now actually i want to conform that ,,,,,for using ssh as a client on pc ,do i have to install ssh in some pc outside my proxy server ???or is there ne way to pypass proxy through some other means???
47shailesh
Mar 12, 2007 at 7:47 PM
desertwind said:
I'm a client trying to access some other server through ssh.

try wpc3015.amenworld.com to acess vis ssh
desertwind
Mar 13, 2007 at 10:52 AM
^^^
WTF. It redirected me to KProxy website. What does an anonymous proxy has to do here?
__________
uchiha.sasuke said:
first of all thanx for ur quick response......


now actually i want to conform that ,,,,,for using ssh as a client on pc ,do i have to install ssh in some pc outside my proxy server ???or is there ne way to pypass proxy through some other means???

I don't think you can byepass proxy. What i'm trying to tunnel it through http proxy, since http port is the only open one (it usually will be in corporate firewalls).
uchiha.sasuke
Mar 13, 2007 at 6:32 PM
ok......... thanx for that info....
Sykora
Sykora #18
Mar 13, 2007 at 7:45 PM
There are some dedicated tools to tunnel through an http proxy. I used htc/hts, there probably are others.

htc -P <address-of-proxy>:<proxy-port> -F 80 <IP-of destination>:80
ssh -p 80 username@name-of-host

You'll have to get hts to listen on the host computer. I don't know if your proxy has a password, if it does I'll have to change that a bit.