Answer the question
In order to leave comments, you need to log in
How to use Plink (Putty) to copy a config from a host behind a firewall?
Good day!
There is a task - to automate the collection of configs from network devices (firewalls).
Implemented using plink and pscp from putty:
in cmd-file:
- plink [email protected] -pw Password -m C:\action.txt
(connect to ME, run commands from txt file)
Action.txt content:
copy startup-config %date%_startup_config
- pscp -pw Password [email protected]:file/%date%_startup_config C:\cfg
(Download the config file from the host: "%date%_startup_config" )
Everything goes fine here, the configs are copied to C:\cfg
However, there are several internal router hosts that are behind the ME, you cannot connect directly to them. I usually use Putty to go to an external ME, run the built-in ssh client on it, and connect to the internal host: ssh connect admin 192.168.10.1. It turns out the session is launched in the session.
What I am trying to do in cmd:
plink [email protected] -pw Password -m C:\action.txt Action.txt
content:
ssh connect admin 192.168.10.1
copy startup-config %date%_startup_config
(1st command to connect from the ME to the internal router behind it, 2nd - saving the config)
plink hangs when executing the first command from action.txt -
ssh connect admin 192.168.10.1
- the text cursor blinks and nothing happens (( The following commands from action.txt are not executed.
Authentication from an external firewall to an internal router - without a password, by key. What am I doing wrong? Can anyone come across this? How to pull out configs through a transit firewall?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question