bounce-bounce-bounce-bounce

Tags:
Add comments

Sur zone0, j’ai des domUs dont le ssh n’est pas accessible depuis Internet. Habituellement, je ssh sur le dom0 puis rebondis. Et puis je me suis souvenu de cette news de Reefab qui pointait une astuce à base de nc. Voici une version compactée et un peu modifiée de la doc en question :

Sur le client :

imil@tatooine:~$ cat bin/netcat-proxy-command
#!/bin/sh
bouncehost=$1
target=$2
port=$3

ssh $bouncehost nc -w 1 $target $port

nc devra evidemment etre installé sur le serveur de rebond (ici, le dom0).
Voici enfin un exemple de .ssh/config :

host cible.gcu.info
Hostname 192.168.0.1
HostKeyAlias cible.gcu.info
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
ProxyCommand bin/netcat-proxy-command rebond.gcu.info %h 2222

Moyennant quoi :

$ ssh cible.gcu.info
Warning: Permanently added 'cible.gcu.info' (RSA) to the list of known hosts.
Enter passphrase for key '/home/imil/.ssh/id_dsa':
NetBSD 4.0 (GENERIC.NOACPI) #0: Sun Dec 16 00:56:55 PST 2007

Welcome to NetBSD!

imil@cible:~$ ifconfig ne2|grep inet\\
        inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255

Leave a Reply

WP Theme & Icons based on GlossyBlue by N.Design Studio
Banner from www.trynthlas.com
Entries RSS Comments RSS Log in
Performance Optimization WordPress Plugins by W3 EDGE