Use it when auditing or setting device passwords and secrets.
Strong secrets
Strong secrets means using enable secret and username … secret with modern hashing (type 8 or 9), long passwords and no default or shared credentials.
1. Use enable secret and username secret with type 9 (scrypt) or 8.
2. Avoid type 7 and type 5 where possible.
3. Long unique secrets.
4. Store in a vault.
5. Rotate.
secret configured with strong hash → stored → verified at login
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show running-config | include secret|passwordVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
service password-encryptiontreated as real protection (type 7 is reversible).- Reusing the same enable secret on every device.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- SSHv2 protects the session; VTY policy still controls who may connect and how users authenticate
- Use a dedicated management VRF/interface where supported and restrict sources with ACL/firewall policy
- Disable Telnet and unused HTTP services
- Prefer named administrators, AAA, least privilege, timeouts and audit logging
- Preserve an out-of-band recovery path before changing remote access.
show running-config | include secret|password— secret typesshow running-config | include service password-encryption— type 7 obfuscation
ReferenceWhat it is1 section · depth on demand
IOS password types
| Type | Algorithm | Status |
|---|---|---|
| 0 | Clear text | Never |
| 7 | Reversible (Vigenère) | Broken — decodable instantly |
| 5 | MD5 | Weak |
| 8 | PBKDF2-SHA-256 | Good |
| 9 | scrypt | Recommended |
enable algorithm-type scrypt secret <secret>
username admin privilege 15 algorithm-type scrypt secret <password>
Documented example, not captured output. Search configs for password 7 and secret 5 and replace them.
ReferenceWhy it matters1 section · depth on demand
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Inventory what is stored today
show running-config | include secret|password|key-string
| Seen in config | Type | Action |
|---|---|---|
password 0 ... / plain text | 0 | Replace immediately |
password 7 0822455D0A16 | 7 | Treat as plain text — reversible; rotate the secret |
secret 5 $1$... | 5 (MD5) | Weak; re-enter as type 9 or 8 |
secret 8 $8$... | 8 (PBKDF2-SHA-256) | Acceptable, sometimes chosen for compliance |
secret 9 $9$... | 9 (scrypt) | Preferred for login secrets |
Cisco's guidance treats type 7 as plain text and MD5 as too weak for stored secrets.
Hashed login secrets
enable algorithm-type scrypt secret <secret>
username admin privilege 15 algorithm-type scrypt secret <secret>
security passwords min-length 14
login block-for 120 attempts 5 within 60
Hashes are one-way: the device can verify a login, but nobody can read the secret back from the configuration.
Secrets the device must be able to use
Some keys must be recoverable by the device itself — routing protocol authentication, RADIUS/TACACS+ keys, pre-shared keys. For those, type 6 (AES, reversible with a device-local master key) replaces type 7:
key config-key password-encrypt <master-key>
password encryption aes
The master key is not in the configuration; a configuration copied to another device needs the same master key to work. service password-encryption (type 7) only hides secrets from casual viewing.
Operating practice
- Prefer central AAA (TACACS+/RADIUS) with one local fallback account.
- Rotate shared secrets when staff leave or a configuration backup is exposed.
- Treat configuration backups as secret material: type 7 and weak hashes in a leaked backup are compromised credentials.
ReferenceConfiguration & state1 section · depth on demand
Configuration
enable algorithm-type scrypt secret <secret>
username admin privilege 15 algorithm-type scrypt secret <secret>
security passwords min-length 12
show running-config | include secret|password
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Security → Device Hardening → Strong secrets. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%