How can i backup running config in a switch using ssh script?
I want to make backups from my switch configs, and i want to use an ubuntu machine with cron for this task, so i can automate it.
My switch is a XGS1930-28HP with firmware version 4.5(ABHS 7.1)
I want to use this command in my script to ssh to the switch:
My switch is a XGS1930-28HP with firmware version 4.5(ABHS 7.1)
I want to use this command in my script to ssh to the switch:
sshpass -p "password" ssh -o StrictHostKeyChecking=no admin@SWITCH_IP COMMAND
My command would be show run, and then i wopuld capture it, and save it a in file.. but i cant use any command with this, because when i try to use it, the switch return me this error:
My command would be show run, and then i wopuld capture it, and save it a in file.. but i cant use any command with this, because when i try to use it, the switch return me this error:
Received disconnect from SWITCH_IP port 22:2: invalid command run.
Disconnected from SWITCH_IP port 22
So, please help me, how can i automate taking backup from my switch configs?
Thanks.
Thanks.
0
All Replies
-
You put "show run" between quotes?
0 -
Just saw another post also about this and seems having workaround there.
https://community.zyxel.com/en/discussion/3401/gs1920-24hpv2-non-interactive-ssh-invalid-command
1
Categories
- All Categories
- 347 Beta Program
- 2.1K Nebula
- 114 Nebula Ideas
- 77 Nebula Status and Incidents
- 5K Security
- 44 USG FLEX H Series
- 246 Security Ideas
- 1.2K Switch
- 65 Switch Ideas
- 901 WirelessLAN
- 33 WLAN Ideas
- 5.8K Consumer Product
- 204 Service & License
- 326 News and Release
- 71 Security Advisories
- 21 Education Center
- 5 [Campaign] Zyxel Network Detective
- 1.8K FAQ
- 831 Nebula FAQ
- 401 Security FAQ
- 219 Switch FAQ
- 190 WirelessLAN FAQ
- 45 Consumer Product FAQ
- 136 Service & License FAQ
- 34 Documents
- 34 Nebula Monthly Express
- 71 About Community
- 61 Security Highlight