Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a issue where, under cygwin, the http_proxy env variable is being ignored. i've tried upper case and lower case for the variable name, it's just not being read by ssh.

export HTTP_PROXY="http://user:pass@proxy.job.com:8080/"

Doesn't use proxy

ssh myuser@home.com

Uses proxy

wget http://home.com/

Does anyone see what i'm doign wrong?

share|improve this question
add comment

1 Answer

Your question is not clear because you don't explain what you're trying to achieve. I'm going to venture a guess, which could of course be wrong. My guess is that:

  • you want to use ssh to connect from your work machine to home.com;
  • ssh home.com doesn't work (hangs, or displays an error message) because your work firewall is blocking outgoing connections;
  • user:pass@proxy.job.com:8080 is the proxy you've configured in your web browser at work.

Since ssh uses the ssh protocol, and not the http or https protocol, it doesn't care about the http_proxy or https_proxy variable.

There is a way to tunnel ssh traffic through an https proxy. The proxy can't distinguish ssh traffic from https traffic since they're both encrypted. Three programs that can do this are netcat (the OpenBSD version), corkscrew and connect-proxy. I'm going to give an example for corkscrew which I know is provided in Cygwin. Use the following settings in your .ssh/config file:

Host home
HostName home.com
User myuser
ProxyCommand /usr/bin/corkscrew proxy.job.com 8080 %h %p /path/to/corkscrew/authfile

and put a single line containing user:pass in /path/to/corkscrew/authfile.

Some proxies won't allow you to connect to port 22 (the normal ssh port), only to port 443 (the normal https port). If you have control over the server at home.com, you can get it to listen on port 443 as well: most likely you'll either want to add 443 to the Port line in the sshd_config file, or to redirect incoming connections on port 443 on your home router to port 22 on your sshd machine. Then add Port 443 below the HostName line in .ssh/config.

Alternatively, if your firewall-piercing efforts fail, look into installing Ajaxterm on a web server outside the firewall.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.