SSH jump via gateway

Written by admin on February 18, 2014 Categories: Ligne de commande, Linux, Network Tags: , , ,

Tout est là : http://en.wikibooks.org/wiki/OpenSSH/Cookbook/Proxies_and_Jump_Hosts

Voici deux exemples :

Host compute02
        User root
        HostName 192.168.41.12
        ProxyCommand ssh -l root magateway -W %h:%p

Host *+*
        ProxyCommand ssh $(echo %h | sed -e 's/+[^+]*$//; s/\([^+=]*\)=\([^+]*\)$/\2 -l \1/; s/^\([^+:]*\):\([0-9]*\)+/-p \2 \1+/' ) -W $(echo %h | sed -e 's/^.*+//; s/:.*$//;'):$(echo %h | sed -e ' s/^.*+//; /:/!s/^.*/22/; s/^.*://' ;)

Je peux ensuite utiliser :

ssh compute02

ou

ssh -l root root=magateway:192.168.41.12

Sources :

http://en.wikibooks.org/wiki/OpenSSH/Cookbook/Proxies_and_Jump_Hosts

https://wiki.gentoo.org/wiki/SSH_jump_host

http://glandium.org/blog/?p=308

No Comments on SSH jump via gateway

Leave a Reply

Your email address will not be published. Required fields are marked *