RE: snmpset to recover router VTY password posted 06/19/2004
Just thought I would share this script that I used.
I have a file named routers.list, which is oddly enough, a list of routers
The script creates a folder of today's date, and moves all the tftp'd
configs to that directory.
Its called from a cron job.
Maybe not the most efficient, and most certainly not the most elegant, but
You would need to adjust some paths to use the script, but I suspect your
just after the MIB.
Short story long, , you can see the MIB I used below.
This was running on a RedHat linux box, 9.0 I believe.
for DEVICE in `more ../routers.list` ;
snmpset -v1 -c $SNMPC $SITEID .22.214.171.124.126.96.36.199.1.55.IP.OF.TFTP.SERVER s
mv ../tftp/*rt* /path/to/backup/$DATESTMP/
From: nobody@xxxxxxxxxxxxxx [mailto:nobody@xxxxxxxxxxxxxx] On Behalf Of
Sent: Friday, June 18, 2004 10:15 AM
Subject: snmpset to recover router VTY password
I have a remote router, R1 that I can not access because VTY password is not
known. The SNMP with Write access is configured on the router R1.
R1 ----------- R2
Linux server with "SNMPSET" command
I can not send a config file to R1 with a VTY password using the "SNMPSET"
command from my linux server as the TFTP source IP is not correctly set on
the R1 (command "ip tftp source-interface" is not configured). I can ping R1
from my linux server, SNMPwalk works and I can telnet to R1 (I can not login
as the VTY password is not known).
There is full IP connectivity between R1 & R2 and I know for sure that
R1 can get a config file, stored in flash of R2 via TFTP if I make the
R2 TFTP server with the command, "tftp-server".
I need to know how to use the SNMPset command on my linux server to instruct
the R2 to send the config file to R1.
Is this possible?
I have tried the below command but it did not work.
snmpset -c <RW community> <routerIP> 188.8.131.52.184.108.40.206.1.53.#.#.#.# s conf
#.#.#.# <- TFTP server IP = R2
<routerIP> = R1
Can you please help on this?
Please help support GroupStudy by purchasing your study materials from:
Subscription information may be found at: