Maintaining administrative control over network infrastructure begins with disciplined credential management. Whether performing routine security rotations, adjusting access privileges for network engineers, or replacing stale passwords on legacy equipment, updating local credentials in Cisco IOS and IOS-XE is a foundational operational task.
While changing a local user’s password on a Cisco router requires only a few commands in the command-line interface (CLI), executing the change correctly requires an understanding of privilege levels, cryptographic hashing standards, and line security. Furthermore, administrators must know how to recover access if a password is forgotten and understand when an organization should transition from individual device accounts to centralized authentication architectures.
Table of Contents
Step-by-Step Guide: Updating a Local Username and Password via CLI
Updating a user’s password in Cisco IOS does not require deleting the account. The Cisco IOS parser processes username statements idempotently: entering a new username command with an existing username immediately overwrites the stored password and privilege attributes associated with that account.
Prerequisites
- Access to the router via a direct serial console connection, Telnet, or SSH.
- An existing account with Privileged EXEC mode access (Privilege Level 15).
Step 1: Enter Privileged EXEC Mode
Log in to the router. If your session lands in user EXEC mode (indicated by a > prompt), elevate your privileges using the enable command:
Router> enable
Password: *********
Router#
Step 2: Enter Global Configuration Mode
Modifications to the local user database must be made in global configuration mode:
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Step 3: Overwrite the Username and Password
Enter the username command, followed by the target username, the desired privilege level, and the secret keyword followed by the new password.
Router(config)# username admin privilege 15 secret CorrectHorseBatteryStaple!
admin: The target account username (case-sensitive in modern IOS-XE versions).privilege 15: Grants full administrative rights, bypassing the need for a secondaryenablepassword to configure the router.secret: Instructs IOS to hash the password before writing it to NVRAM.
Step 4: Verify the Updated Configuration
Return to privileged EXEC mode and inspect the running configuration filtered by the username:
Router(config)# do show running-config | include username
username admin privilege 15 secret 9 $9$vD8e...
Verify that the account exists with the intended privilege level and that the output displays a hashed string rather than plaintext.
Step 5: Save the Configuration to NVRAM
Changes made in configure terminal reside only in volatile RAM (running-config). To ensure the new password persists across reboots, commit the changes to NVRAM:
Router# copy running-config startup-config
Destination filename [startup-config]? [Enter]
Building configuration...
[OK]
Alternatively, the legacy shorthand write memory executes the same function.
Frequently Asked Questions: Understanding password vs. secret and Hashing Types
What is the technical difference between the password and secret keywords?
When configuring local user accounts, Cisco IOS accepts either username <name> password <string> or username <name> secret <string>.
The password keyword historically stores the string in cleartext (Type 0). Even if the global command service password-encryption is enabled, the password is only masked using Cisco’s proprietary Type 7 encoding—a simple Vigenère-cipher variant that can be decrypted in milliseconds using widely available tools.
The secret keyword forces the router to pass the plaintext string through a one-way cryptographic hash function before storing it. The router never writes the plaintext string to memory or storage.
What do Cisco password encryption types (Type 0, 7, 5, 8, 9) mean?
- Type 0 (Plaintext): Unencrypted, readable text stored directly in the configuration file.
- Type 7 (Proprietary Obfuscation): A weak XOR-based masking algorithm. It prevents casual “over-the-shoulder” viewing of configuration files, but provides zero cryptographic defense against unauthorized decryption.
- Type 5 (MD5): A one-way hash algorithm based on MD5 with a salt. While far superior to Type 7, modern GPU computing clusters can crack Type 5 hashes via brute-force and dictionary attacks.
- Type 8 (PBKDF2 with SHA-256): Introduced in Cisco IOS 15.3(3)M and IOS-XE 3.10S. It applies a Password-Based Key Derivation Function with a SHA-256 HMAC and high iteration counts, offering robust resistance against brute-force attacks.
- Type 9 (Scrypt): A memory-hard hash function designed specifically to thwart hardware-accelerated attacks (such as ASICs and GPUs). Type 9 is the strongest hashing mechanism natively supported in modern Cisco platforms.
Why is service password-encryption insufficient for enterprise security?
The service password-encryption command applies only Type 7 encoding to plaintext passwords found in commands like password or enable password. Because Type 7 is a reversible cipher rather than a hash, anyone who obtains a copy of your configuration file through TFTP snooping, backup repository compromises, or shoulder surfing can reverse the cipher back to cleartext instantly.
Which password algorithm should administrators use?
Whenever supported by the platform, administrators should configure Type 9 (scrypt) or Type 8 (SHA-256) hashes explicitly:
Router(config)# username admin privilege 15 algorithm-type scrypt secret Str0ngP@ssw0rd!
If the legacy software image does not support algorithm-type, the standard secret keyword defaults to Type 5 (MD5), which remains considerably safer than Type 7.
Configuration Template: Secure Local User Provisioning with SSH
To put these credential parameters into practice, the following production template configures an administrative local account, disables insecure Telnet, generates 2048-bit RSA keys, and restricts console and virtual terminal (VTY) access strictly to local database authentication over SSH Version 2.
! ====================================================================
! Cisco IOS / IOS-XE Production Local Administrator & SSH Template
! ====================================================================
configure terminal
! 1. Define device naming context (required for RSA key generation)
hostname R1-CORE
ip domain-name enterprise.internal
! 2. Generate RSA key pair for SSH negotiation (2048-bit minimum)
crypto key generate rsa modulus 2048
! 3. Enforce SSH Version 2 and set basic connection boundaries
ip ssh version 2
ip ssh time-out 60
ip ssh authentication-retries 3
! 4. Create primary administrative user using Type 9 (Scrypt) hashing
username admin privilege 15 algorithm-type scrypt secret C1sc0$ecure2026!
! 5. Secure Virtual Terminal (VTY) lines (Telnet blocked, SSH required)
line vty 0 4
exec-timeout 10 0
logging synchronous
login local
transport input ssh
line vty 5 15
exec-timeout 10 0
logging synchronous
login local
transport input ssh
! 6. Secure auxiliary and console lines with local database validation
line con 0
exec-timeout 15 0
logging synchronous
login local
line aux 0
no exec
! 7. Commit changes to persistent storage
end
write memory
Disaster Recovery Guide: Resetting Passwords via ROMMON Without Losing Configuration
If the administrative password is lost or an administrator is completely locked out of the router, credentials can be reset through physical console access using the ROM Monitor (ROMMON) recovery procedure. This process alters the configuration register to bypass the startup configuration during boot, allowing the password to be overwritten without erasing existing network parameters.
Step 1: Establish a Physical Console Connection
Connect a serial rollover cable from your workstation to the router’s RJ-45 or USB console port. Open a terminal emulator configured for standard serial settings:
– Baud Rate: 9600 bps
– Data Bits: 8
– Parity: None
– Stop Bits: 1
– Flow Control: None
Step 2: Interrupt the Router Boot Sequence
- Power cycle the router (turn the power switch off, wait 10 seconds, then turn it on).
- Within the first 60 seconds of booting, send a Break signal from your terminal emulator (e.g.,
Ctrl + Breakin PuTTY or Tera Term). - The boot sequence aborts, dropping the console into the ROMMON prompt:
text
rommon 1 >
Step 3: Instruct the Router to Ignore the Startup Configuration
Instruct the processor to bypass NVRAM during startup by changing the configuration register from its standard value (0x2102) to 0x2142:
rommon 1 > confreg 0x2142
rommon 2 > reset
The router will reboot, ignoring the stored configuration, and load a blank system image.
Step 4: Bypass the Initial Setup Dialog and Merge Configuration
When the router boots, it will present the initial configuration dialog. Reject it:
Would you like to enter the initial configuration dialog? [yes/no]: no
Router>
Enter privileged EXEC mode (no password will be prompted):
Router> enable
Router#
Crucial Step: Do not enter configuration mode and make changes yet. You must load your existing configuration from NVRAM into active memory:
Router# copy startup-config running-config
Destination filename [running-config]? [Enter]
R1-CORE#
Note: Once this command executes, the router prompt changes back to its configured hostname (R1-CORE#), and all interfaces, routing tables, and access lists are preserved.
Step 5: Overwrite the Password and Restore Interfaces
Interfaces loaded from the startup configuration remain in an administratively down state to prevent routing loops during recovery. Re-enter global configuration mode, reset the administrative password, re-enable interfaces, and restore the configuration register to normal operation (0x2102):
R1-CORE# configure terminal
R1-CORE(config)# username admin privilege 15 algorithm-type scrypt secret NewRecoveryP@ss2026!
R1-CORE(config)# config-register 0x2102
R1-CORE(config)# interface GigabitEthernet0/0/0
R1-CORE(config-if)# no shutdown
R1-CORE(config-if)# exit
R1-CORE(config)# exit
Step 6: Commit Repaired Configuration
Write the modified configuration containing the new credentials and restored register setting back to NVRAM:
R1-CORE# copy running-config startup-config
[OK]
The router is now accessible with the new credentials and will boot normally on subsequent restarts.
Official Cisco Architecture Standards and Command Reference
According to the Cisco IOS Security Configuration Guide: Securing User Services and the Cisco IOS Master Command Reference, local user management operates under strict structural parameters defined by the system architecture.
Formal Command Syntax
username name [privilege level] [algorithm-type {md5 | sha256 | scrypt}] secret secret-value
name: Case-sensitive string (up to 64 characters on modern IOS versions) identifying the credential holder.privilege level: An integer ranging from0to15.0: Provides access to only basic operational commands (logout,enable,exit).1: Default user EXEC level (read-only diagnostics such as non-privilegedpingorshowcommands).15: Full administrative system privileges (equivalent to root). Levels 2 through 14 can be assigned custom command authorization profiles via theprivilege <mode> level <num> <command>syntax.algorithm-type: Designates the key derivation scheme. Omitting this token causes IOS to fall back to the default hashing method configured globally or the platform’s default (MD5 on older releases).
Architectural Limitations of the Local User Database
Cisco’s official security architecture frameworks outline clear limitations regarding the local user database:
- Scalability Boundaries: Local user definitions are bound to the NVRAM of each specific device. Managing credentials across hundreds of devices results in manual configuration overhead and a higher probability of human error.
- Absence of Centralized Accounting: While local accounts can authenticate an administrator and authorize them to privilege level 15, the local database cannot generate granular, real-time command accounting logs showing which commands an engineer executed.
- Password Lifecycle Limitations: Local user databases do not provide native password aging, complexity policies, account lockouts after sequential failures, or multi-factor authentication (MFA) without secondary AAA frameworks.
Centralized AAA vs. Local Authentication: Architectural Comparison
As enterprise networks expand beyond a handful of routing devices, managing standalone passwords across individual hardware endpoints becomes unsustainable. The industry standard replaces or supplements local databases with centralized Authentication, Authorization, and Accounting (AAA) servers running TACACS+ or RADIUS.
The following comparison details the operational and technical differences between local user management, TACACS+, and RADIUS:
| Comparison Metric | Local Router Database | TACACS+ (e.g., Cisco ISE) | RADIUS (e.g., FreeRADIUS, Microsoft NPS) |
|---|---|---|---|
| Primary Standard / RFC | Proprietary to Cisco IOS NVRAM | RFC 8907 (Cisco Origin) | RFC 2865 / RFC 2866 (IETF Open Standard) |
| Transport Layer & Ports | Internal system memory | TCP Port 49 (Reliable connection) | UDP Ports 1812/1813 or 1645/1646 |
| Packet Encryption | N/A (Stored locally) | Entire packet payload encrypted | Only the password field is hashed (MD5) |
| AAA Architecture | Monolithic (Authentication couples with Privilege) | Fully Modular: Authenticates, authorizes, and accounts independently | Combines Authentication and Authorization into a single response |
| Per-Command Authorization | No (Limited to static privilege levels 0–15) | Yes: Validates individual CLI commands on the AAA server in real time | No (Practically limited to assigning privilege attributes) |
| Accounting Granularity | Minimal (Local syslog events only) | High: Logs every executed command, execution timestamp, and user identity | Session-level accounting (start, stop, time, and packets transferred) |
| Credential Management | Per-device manual rotation or orchestration | Centralized directory integration (Active Directory, LDAP, SAML, MFA) | Centralized directory integration (Active Directory, LDAP, 802.1X) |
| Primary Industry Use Case | Disaster recovery, emergency out-of-band access | Device Administration (TACACS+ is built for CLI management) | Network Access Control (NAC, 802.1X, VPN client authentication) |
Conclusion
Updating an administrative password on a Cisco router is a simple operation using the username <name> privilege 15 secret <password> syntax, but doing so securely requires careful attention to cryptographic hashing. Administrators should avoid the vulnerable password keyword and Type 7 cipher in favor of modern Type 8 (SHA-256) or Type 9 (scrypt) hashing.
While local accounts remain essential as reliable, out-of-band fallbacks during network outages or password recovery procedures, production environments should ultimately delegate routine access to centralized AAA protocols like TACACS+. This layered approach ensures that local credentials serve their true purpose: a secure, hardened safety net for disaster recovery.











Comments