logos

With Andrii Grytsenko


Technical Diary - With Andrii Grytsenko

SSH connection via http-proxy

How to get access to external server in the event of you can reach internet only over the http proxy server.

Sometimes I work in environment where I have no direct access to the internet. But I need to have connection to my remote server. For this purpose I use corkscrew software. In this post I’ll try describe how it’s work. It’s very easy get in several step.

First of all we need to get corkscrew.

You cat get it in next way for debian:

# apt-get install corkscrew 

or download sources from official site and compile it for your distro:

#tar -xzvf corkscrew-2.0.tar.gz
# [..]
#cd corkscrew
#./configure
#make install

It’s doesn’t matter which way you have chosen.

Add new string to your ssh_config to use this to all users at the system or in $HOME/.ssh/config. As I have proxy on host proxy_host which listened at port 8080 and want to use this rule only for me. That’s why I put next:

$ cat ~/.ssh/config
ProxyCommand corkscrew proxy_host 8080 %h %p

Also if you should be authenticated at proxy side. You can simply add this feature. Just modify string in your config.

From:

ProxyCommand corkscrew proxy_host 8080 %h %p

To:

ProxyCommand corkscrew proxy_host 8080 %h %p /path/to/auth_file

And create /path/to/auth_file with next format :

username:password

Now I’ll try to check it:

$ ssh -p 443 my_user@host.in.inet
my_user@host.in.inet's password:

Ok I’ve got access to it :). Therefore I suspect everything work in proper way.

Leave a Reply

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Categories

Translate