I am trying to create a batch file for running commands on my router
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2022 03:08 AM - edited 01-07-2022 06:42 AM
I have the current script written to get me into the router.
"plink.exe" -ssh username@host -pw password < "input.txt"
The problem is once I am in the router I need it to enable and then enter another password in before I can execute commands. When I run this script it gets to the enable part but does not enter in the password. From what I am understanding in my "input.txt" I have the command "enable" which it executes, but if I put anything after that it runs it as a new command. After I enter in the "enable" command I need it to enter a password before executing more commands and I can't just put it right underneath "enable" in the "input.txt."
Is there a way to fix this?
Here is the input.txt I have set up
enable password config t (I would like to enter different commands here once in configuration mode)
Thank you for your help.
- Labels:
-
Other Routers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2022 06:40 AM
is the user in privelage 15 if not use that priv 15 and test it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2022 06:45 AM
I am in privelage 15. Also, after testing multiple things I have updated my question to better reflect my issue.
Thank you for trying to help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2022 09:31 AM - edited 01-07-2022 09:32 AM
input commands to send after login, so the enable should be done before it process inputs.
If you use privalage level 15 user, the enable password not required, based on your VTY config.
like below :
line vty 0 4
no login
privilege level 15
