Using SSH to connecting to an host when an HTTP Proxy is between the client and the host, can not be done directly without some configuration.
On Linux based machines the solution is to install and run corkscrew, a program that can tunnel the SSH protocol through an HTTP Proxy.
So how to do the configuration?
1) First install the corkscrew program with your package manager. On Ubuntu family: apt-get install corkscrew
2) Then you need to configure SSH to use corkscrew when connecting to the host that has a http proxy between.
3) Goto to your home directory and change to the hidden directoy .ssh within a command shell window.
4) Create or edit a file named config. The name is just config. No extensions.
5) Add the following lines to the config file
Host <IP_of _remote_host> ProxyCommand corkscrew <IP_of_HTTP_Proxy> <HTTP_Proxy_Port> %h %p <auth_file>
Where the <IP_of_remote_host> is the public ip address of the host where you wish to connect.
The <IP_of_HTTP_Proxy> and <HTTP_Proxy_Port> are the IP address and Port of you local http proxy server that you wish to go through.
And finally, if your proxy server requires authentication, by username and password, just give a complete path to a file where Proxy credentials are stored, for example /home/primalcortex/.corkscrew_auth
This file content must be something like:
For example a complete config file example:
Host 18.104.22.168 ProxyCommand 192.168.1.1 8080 %h %p /home/primalcortex/.corkscrew-auth
and the .corkscrew-auth file:
6) Just connect now:
or when not using the default ssh port:
ssh -p 12345 firstname.lastname@example.org
So why we need this?
Well, first is of course, to access a remote machine, but ssh can forward local ports to remote ports, and this is important because, with this feature we can use Thunderbird to directly connect to a remote server by using the standard IMAP and SMTP protocols through an HTTP proxy.