GNU/Linux

- Paramètres :

  • proxy squid utilisé : proxy.foo.bar:3128
  • votre serveur SSH tourne sur le port 443
  • le nom DNS de votre serveur SSH est : host.example.com et son IP privée : 10.0.0.1

- Installer corkscrew

- Configurer votre serveur SSH

Modifier le fichier /etc/ssh/sshd_config


# What ports, IPs and protocols we listen for
Port 22
Port 443

Rq : si vous avez un serveur web https tournant sur le port 443 (apache-ssl ou apache2), il faudra changer le port de votre serveur web...

- Configurer votre client SSH

Dans votre fichier ˜/.ssh/config


# Global configuration
Compression yes
CompressionLevel 7
ServerAliveInterval 25

Host *
       # Sharing multiples sessions
       # over a single network connection
       ControlMaster auto
       ControlPath /tmp/ssh_%h_%r

# Configuration for host.example.com
Host chez-moi
HostName host.example.com
       # Local SSH Server port
       Port 443
       # Automatic login
       #User Thus0
       # Keep-Alive
       KeepAlive yes
       ProtocolKeepAlives 60
       # Use proxy squid with login/passwd
       ProxyCommand /usr/bin/corkscrew proxy.foo.bar 3128 %h %p /home/thus0/.ssh/proxy_auth
       # Use proxy squid without authentication
       # ProxyCommand /usr/bin/corkscrew proxy.foo.bar 3128 %h %p
       # Trusted X11 Forwarding
       ForwardX11Trusted yes
       # Google Talk
       LocalForward 5222 talk.google.com:5222
       # Imap
       LocalForward 9993 10.0.0.1:993
       # IRC
       LocalForward 6667 irc.freenode.net:6667
       # LDAP
       LocalForward 9389 10.0.0.1:389
       # News
       LocalForward 9119 news.neuf.fr:119
       # SMTP
       LocalForward 9925 smtp.neuf.fr:25
       # Squid
       LocalForward 3128 localhost:3128
       # If you use port forwading for example, you can use a host key alias...
       #HostKeyAlias forwardhostexamplecom
       # If you have a dynamic IP Address, to avoid warning messages.
       #CheckHostIP no

Si vous utilisez un proxy authentifiant, il faut créer un fichier contenant votre login/passwd, par exemple créer un fichier ˜/.ssh/proxy_auth contenant :


login:password

- Utilisation

Si tout est bien configuré, il suffit de taper dans une console :


$ ssh login@chez-moi

Windows

- Environnement cygwin : idem que pour GNU/Linux

- Utilisation de putty

... cf. http://tcweb.org/mediawiki/index.php/Traverser_un_proxy

Documentation