SSH: running various commands on a router
I have set up ssh to connect with a RSA key to a router. Now, I want to be able to run a chain of commands on that router the problem is that I can't send them separated with ; cause the router doesn't understand the separation, so I have to send the "<enter>" keys somehow.
I tried to do it like this:
( echo ping localhost; echo ping localhost; ) | ssh -i blah user@router
The connection is established, but it gets broken after login and no command is executed.
Is there a way I could tell ssh to read a text file where the chain of commands is?
Thanks in advance