There is no single managed-switch password recovery procedure, and that is the whole problem. On a Catalyst 2960 you rename one file in flash and everything survives. On a MikroTik CRS you lose the lot. On a UniFi switch the question barely applies, because the configuration was never stored on the switch to begin with. Same symptom, three completely different afternoons.
Why this is not one procedure
Three things decide which afternoon you are having.
The first is where the credential physically lives. On IOS, IOS-XE, Junos, EOS and Comware the passwords are lines of text inside the configuration file, and the configuration file is an ordinary file on an ordinary filesystem. Anything that boots the box without applying that file hands you an unauthenticated CLI with the file still sitting there, untouched. What the vendor calls password recovery is really a deferred config load.
The second is whether the bootloader is a shell or a dead end. Cisco’s switch: prompt, Arista’s Aboot, the Junos loader and Comware’s Boot ROM all run before the operating system’s authentication exists, and will happily list, rename or read files for you. A Netgear GS308E exposes no console and no bootloader menu at all, so the reset button is the entire interface the vendor gave you.
The third is whether a previous administrator already closed the door. no service password-recovery on IOS, undo password-recovery enable on Comware, no front-panel-security password-clear on AOS-S, set system ports console insecure on Junos — each is a supported hardening option, each turns a fifteen-minute job into a rebuild, and each was usually applied by someone who was right to apply it.
There is a vocabulary problem on top of all that. “Password recovery” means at least four different things depending on whose manual you are reading: clear the stored passwords and keep everything else; boot without applying the config and let you read it back afterwards; boot with authentication disabled on the console port only; or — on more products than the marketing suggests — a polite synonym for factory reset.
- Needs console access
- Almost every config-preserving path. Web and SSH are gone by definition.
- Serial settings
- 9600 8N1 on Cisco, Juniper, Arista, AOS-S, Comware, ICX. 115200 on Aruba CX and Netgear M-series. 38400 on TP-Link JetStream.
- Config survives
- Cisco, Juniper, Arista, HPE AOS-S, HPE Comware, Ruckus ICX, Dell N-series, Netgear M-series, TP-Link JetStream
- Config does not
- MikroTik, Zyxel smart-managed, unmanaged-tier web switches, and anything with recovery disabled
- Config held off-box
- UniFi, Omada controller, Meraki, Aruba Central, FortiSwitch under FortiLink
- Worst outcome
- Saving the empty running config over the startup file before you have read it
Before you reach for the paperclip
A surprising number of “locked out” switches are not locked out. Work through this before you touch the hardware, because every option below is free and reversible, and the ones after it are not.
- Check the AAA path, not the switch. If the switch authenticates against TACACS+ or RADIUS, the credential you need lives on a server you may still control. The local account only matters as fallback.
- Try SNMP. A read-write community string from the deployment era is often still configured and still known. With one you can pull the running config off a Cisco box over TFTP via CISCO-CONFIG-COPY-MIB without ever logging in.
- Check your backup collector. Oxidized, RANCID, Unimus, LibreNMS and every NCM product have been quietly saving
show running-confignightly for years. Last night’s copy is usually within one change of current. - Check the web UI separately from SSH. On several small-business platforms the HTTP user database and the CLI enable secret are configured independently, and only one of them got changed.
- Check whether the box is controller-managed at all before you assume the config is on it.
If none of those land, you are into hardware recovery, and the general escalation order is covered in the locked-out device recovery ladder. Everything from here needs a serial console — see serial console access if you have not built that cable yet.
Vendors that give the configuration back
| Platform | Way in | What happens to the config |
|---|---|---|
| Cisco IOS / IOS-XE Catalyst | Mode button into the boot loader, or ROMMON | Untouched in flash or NVRAM; you reload it manually |
| Cisco Business 250/350/550, legacy SG300/SG500 | Startup menu, password recovery entry | Startup config intact; boots with authentication off |
| Juniper Junos (EX series) | boot -s at the loader, then recovery |
Live config; you set root auth and commit |
| Arista EOS | Ctrl-C into Aboot, edit /mnt/flash/startup-config |
You have the file open in a text editor |
| HPE/Aruba AOS-S (2530, 2540, 2930F/M) | Clear button alone, about one second | Clears passwords only; everything else stays |
| HPE Comware (5130, 5140, 5945) | Boot ROM, Skip current system configuration | Still on flash but not loaded — read it before you save |
| Ruckus / Brocade ICX | b during boot, then no password, then boot |
Boots the full config, drops you into enable |
| Dell Networking N-series (OS6) | Boot menu, Start Password Recovery | Boots normally with the login prompt suppressed |
| Netgear M4100 / M4200 / M4300 / M4250 / M4350 | Boot menu, password recovery entry | Preserved; you set a new username admin password |
| TP-Link JetStream / Omada Sx3–Sx6 | Ctrl-B into the BootUtil menu, password reset entry | Deletes the user accounts; the rest of the config is retained |
| Extreme EXOS / Switch Engine | bootROM: config none then boot |
Boots default, but the saved .cfg survives on flash |
Read the menu, not the number
On the menu-driven platforms — Cisco Business, Netgear M-series, Dell N-series, TP-Link — the factory-reset entry sits on the same short list as password recovery, a line or two away, and the numbering has moved between firmware generations. Guides that tell you to press 3 are quoting one build of one model. Read the wording on your screen.
The Cisco procedure is the one everybody has done, and it is worth being precise about, because there are two variants and people mix them up. On a 2960, 2970 or 3560 you hold the Mode button while applying power. The documented LED cue differs across the 2960, 2960-S and 2960-X generations, so treat the switch: prompt appearing on the console as the real signal and keep holding until you see it. Some builds then ask whether to reset the system to the default configuration — answer no, and it renames config.text to config.text.renamed and boots without it. Other builds drop you straight to switch:, where you do it yourself.
switch: flash_init
Initializing Flash...
flashfs[0]: 3 files, 1 directories
...done Initializing Flash.
switch: rename flash:config.text flash:config.old
switch: boot
Once it boots into setup mode, decline the dialogue, get to enable, then put it back: rename flash:config.old flash:config.text followed by copy flash:config.text system:running-config. Now you have the whole configuration running, with an unknown enable secret you are about to overwrite.
Catalyst 9200 and 9300 work differently and more cleanly — the config is in NVRAM, not a file you rename. At the ROMMON prompt set SWITCH_IGNORE_STARTUP_CFG=1 and boot. Afterwards, restore with copy startup-config running-config, change the password, then clear that flag and write memory. Skip the clearing step and the switch comes up blank on every future reload, which is a memorable way to find out about it at 3am.
The one mistake that actually costs you the config
On Cisco Business, Comware and anything else that boots you in with an empty or partial running config, a reflexive write memory or save before you have reloaded the old configuration overwrites the startup file with nothing. Cisco’s own small-business documentation puts copy startup-config running-config as step one for exactly this reason. Read or reload first. Save last.
Junos is the gentlest of them. Interrupt the boot, type boot -s at the loader, then recovery when it asks for the pathname of the shell. You land in a normal CLI with the full configuration loaded, and you simply set system root-authentication plain-text-password and commit. Nothing was ever at risk. Arista is nearly as good in a cruder way: Ctrl-C early in boot gets you the Aboot shell, and since /mnt/flash persists across it, you can open startup-config in vi, delete the enable secret line, and boot.
HPE’s AOS-S switches are the outlier in the good direction, because recovery is a physical button rather than a console procedure. A press of Clear on its own for roughly a second clears the manager and operator passwords and leaves the configuration entirely alone. Reset and Clear together is the factory reset. Two buttons a few millimetres apart with wildly different consequences, which is worth knowing before you go poking at a 2930F in a dark comms room. Check show front-panel-security on your other switches while you still can — if password-clear shows as disabled, that button will do nothing for you.
Vendors that make you start again
| Platform | What you have to do | Mitigation |
|---|---|---|
| MikroTik RouterOS and SwOS | Reset button, reset jumper, or Netinstall | None. There is no supported password recovery. |
| Aruba CX 6100–6400, 8xxx | ServiceOS recovery, which clears the startup config | Roll forward to a checkpoint after you get in |
| Zyxel GS1900 / GS1920 | Restore button on the front panel | None |
| Netgear GS3xxE, TP-Link TL-SG1xxE, D-Link DGS-1100, Zyxel GS1200 | Reset button. No console, no bootloader menu. | None |
| Ubiquiti UniFi switches | Reset button, ten seconds | Re-adopt; the controller holds the config |
| Any platform with recovery deliberately disabled | Wipe, and on IOS the switch wipes itself when you try | None, by design |
MikroTik is the honest one about it. The documentation says plainly that the only way back into a device with a lost password is a reset to defaults, and that all configuration will be lost. Netinstall does not change that — it reinstalls RouterOS, it does not decrypt anything. Older RouterOS versions stored recoverable credentials in .backup files and a small industry of extraction tools grew up around that; current versions do not, and if you find a tool claiming otherwise it is either ancient or lying.
Aruba CX deserves its own note, because it sits awkwardly between the two tables. Recovery runs through ServiceOS, the small environment that loads before AOS-CX, and it ends with the startup configuration cleared — there is no “clear the password and carry on” option. What softens that is the checkpoint store, which AOS-CX keeps separately from the running and startup configs: once you are back in on a blank config, you roll forward to the most recent checkpoint. Confirm what you have with show checkpoint rather than assuming the latest state was captured, and do not reach for erase all zeroize first, because that takes the checkpoints with it. The ServiceOS keystrokes have shifted across AOS-CX releases and the command in question is destructive, so take it from HPE’s article for your version rather than from memory.
Controller-managed switches are a different question
On UniFi, Omada, Meraki MS, Aruba Central, Mist and FortiSwitch in FortiLink mode, the device password is irrelevant because the controller sets it. Hold reset for ten seconds, re-adopt, and everything comes back down. The corollary is less comfortable: if you lose the controller, no amount of switch access gets the configuration back.
The general shape of a bootloader recovery
Every config-preserving procedure in the first table is the same five moves wearing different vendor clothing. If you are in front of a platform this article does not name, work the pattern rather than guessing at commands.
- Get a console, physically. Nothing below works over the network. Start at 9600 8N1 with no flow control, and if you get line noise instead of a banner, work through the other speeds listed at the top.
- Interrupt the boot. The interrupt key is almost always documented and almost never the same: Ctrl-C on Arista, Ctrl-B on TP-Link,
bon Ruckus ICX, Escape or Return on Cisco Business, the Mode button on fixed Catalysts. Netgear, Dell and Extreme each use their own key and their own few-second window, so look yours up rather than hammering guesses. Start pressing before the first line of output appears. - Find the option that bypasses rather than erases. In a menu it will be worded as password recovery, skip configuration, or start without configuration. In a shell it will be a file rename or an environment variable. If the only options are factory reset and firmware download, you are in the second table.
- Reload the configuration before you change anything. This is the step that gets skipped. The device is now running with an empty or default config and the real one is still on disk — pull it back in first.
- Set the credential, clear the bypass, then save. In that order. Anything that put the device into a special boot mode has to be undone explicitly, or the next reload repeats the problem without you there.
Getting the config off before you reset
If you have concluded you are facing a wipe, spend ten more minutes trying to extract the configuration first. Even on platforms with no password recovery, the bootloader will often read files it has no business reading.
On a Catalyst, flash_init followed by more flash:config.text dumps the entire configuration to the console with no authentication involved — turn on your terminal emulator’s session logging first and you have a complete backup. Arista’s Aboot is a real shell: cat /mnt/flash/startup-config. Junos in single-user mode gives you a FreeBSD shell and /config/juniper.conf.gz. Comware’s Boot ROM has a file-display option and, on most builds, TFTP. Extreme documents it the other way round — boot with config none, TFTP the saved .cfg off, edit the credential lines on your laptop, and load it back.
Once you have the text, a factory reset stops being a rebuild and becomes a paste. Set the device back to defaults, look the factory credentials up in the A–Z default password index or on the relevant brand page — the Cisco defaults alone cover a dozen different console behaviours — then paste the configuration back with the credential lines replaced.
Type 7 is not encryption
If the configuration you just extracted has Cisco type 7 passwords in it — the ones produced by service password-encryption, starting 7 08... — those are reversible, and always have been. You can recover the plaintext. Type 5 (MD5-crypt), type 8 (PBKDF2) and type 9 (scrypt) are real hashes and you cannot. What you can do with a hash is paste it back verbatim onto the rebuilt switch, which preserves access for everyone who still knows their password even though you never learned it.
After recovery: what to check
Getting a prompt back is about two thirds of the job. The rest is the things that quietly did not come back with it.
- Confirm the config is actually loaded, not just the login working. Count interfaces.
show running-config | include ^interfaceand compare against port count. A switch that boots into a blank config and accepts your new password looks identical to a successful recovery for about four minutes. - Clear the boot-time bypass. The classic casualty: config-register left at
0x2142, orSWITCH_IGNORE_STARTUP_CFGstill set, orconfig.textstill namedconfig.text.renamed. All three behave perfectly until the next power cut. - Check the VLAN database separately from the config. On IOS, VLANs live in
vlan.dat, not in the configuration file — which is why renamingconfig.textnever cost you any VLANs, and equally whyerase startup-configon its own does not remove them. There is a longer list of things that outlive a wipe in what a factory reset does not erase. - Re-key what is hashed. RADIUS and TACACS+ shared secrets, SNMPv3 credentials and 802.1X settings come back as hashes if you restored a config file, and as nothing at all if you rebuilt. A switch that authenticates admins against a RADIUS server it can no longer talk to is a second lockout waiting to happen.
- Expect SSH host key warnings. Regenerating crypto keys, or rebuilding under a different hostname and domain name, changes the host key. Warn people before someone files a ticket about a suspected MITM.
- On Ruckus ICX, save and reboot a second time. The
no passwordboot gets you in, but remote access stays broken until you set credentials, save, and reload again. - Take the backup you did not have. Point Oxidized or your NCM at the switch the same day. The reason this article exists is that the configuration only lived in one place.
The uncomfortable pattern across all of it: the vendors that make recovery easiest are the ones whose switches are easiest to compromise with ninety seconds of physical access, and the vendors that force a rebuild are, in that narrow sense, doing the right thing. A Catalyst in an unlocked cabinet with default front-panel behaviour is one paperclip away from someone reading your entire configuration at the switch: prompt. Which is the argument for no service password-recovery — and the argument for having a backup good enough that you can afford to turn it on.



