D
D
Darkcloud2019-05-15 09:36:35
SSH
Darkcloud, 2019-05-15 09:36:35

How to remotely run a command on a router?

There is an Edimax router. You need to write a script that will backup the router configs. In the CLI, this is done with the "config save tftp... " command. After that, the config is uploaded to the server. How can I remotely run this command in the CLI of the router?
ssh [email protected] 'command' and ssh [email protected] -t command. Do not work, error "exec request failed on channel 0"

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Darcloud, 2019-05-18
@Darcloud

The question can be closed. I found the solution in the form of a script written in expect . If anyone is interested, I can write.

M
Mikhail Khorev, 2019-05-15
@KhoreffMikhail

There is a paramiko library in python.
But you have to hack the script.
There are a million ready-made products for collecting configs, but something simple - set and clicked is not remembered.
Maybe RANCID can be screwed
Or Ansible
Products are strong, you will have to study a lot of new things, perhaps in this case "from a cannon to sparrows"
Solarwind and ZOHO also have utilities for collecting configs, but they are very paid.

Z
zohan1993, 2019-05-15
@zohan1993

What model of router?
If there is SNMP, you can try through it.
Find the required OIDs and their order, then hook it all up with bash/python + cron.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question