[j-nsp] remote ssh command to an EX series switch

Emmanuel Halbwachs Emmanuel.Halbwachs at obspm.fr
Tue Sep 7 09:06:56 EDT 2010


Hello,

Just in case I'm not the only ignorant fool...

Emmanuel Halbwachs a écrit (Mon, Sep 06, 2010 at 05:33:13PM +0200) :
> Generally speaking, I think rancid's [1] jlogin is what you're looking
> for to run arbitrary commands remotely, e.g.
> 
>   jlogin -c "sh arp" myrouter

I just discovered that JUNOS supports piping multiple CLI commands in ssh remotely:

unixbox$ cat opmode-commands
sh foo
sh bar
sh baz

unixbox$ cat confmode-commands
configure
edit foo bar
quit

unixbox$ cat opmode-commands   | ssh router
unixbox$ cat confmode-commands | ssh router

So, in combination with SSH public key and SSH agent/passphraseless
keypair, you can script things without rancid.

HTH,

-- 
Emmanuel Halbwachs                       Observatoire de Paris-Meudon
Resp. Réseau/Sécurité                           5 Place Jules Janssen
tel  :  +33 1 45 07 75 54                        F 92195 MEUDON CEDEX
fax  :  +33 1 45 07 01 89       véhicules : 11 av. Marcelin Berthelot


More information about the juniper-nsp mailing list