I have a script that will ssh
to a list of routers and run commands from commands.txt
. I want to enable
after I connect to the router through ssh
before I execute the rest of my commands in commands.txt
I have two questions. First, how do I pass the enable command? It doesnt seem to be doing anything when I put it as my first line in commands.txt.
Second, Once I figure out the enable
prompt part, how would I pass my credentials for the script to be fully automatic?
Script
Commands.txt
When I run this current script I enter my password when it prompts me for connection to the router. Then it just displays % Type "show ?" for a list of subcommands
and then goes on and connects to the next router and asks for my credentials.