Network Bytes · Episode 95 · CCNA 5.3
"enable secret vs enable password"
Both enable password and enable secret guard a Cisco router's privileged mode. Enable password sits in the config in plain text; enable secret is stored as a one-way hash, and when both are set, only the secret is used.
What they protect
A Cisco router starts you in user EXEC mode (Router>). Typing enable takes you to privileged EXEC mode (Router#), the level where you can see and change the whole configuration. Both commands put a password on that door:
`` Router> enable Password: Router# ``
Think of two locks for the same door: a door code on a sticky note and a fingerprint scanner.
enable password: the sticky note
`` enable password apple ``
This password sits in the running and startup config in plain text. Anyone who sees a config backup, a show running-config screenshot or a help-desk ticket can read it. service password-encryption only hides it behind Type 7 encoding, which is weak and reversible: free tools decode it in a second.
enable secret: the fingerprint scanner
`` enable secret mango ``
The router stores only a scrambled, one-way hash of the secret (it shows up as something like enable secret 9 $9$...). When you type a password, the router hashes what you typed and compares the two hashes. Nobody can decode the original password back from the stored value. On current IOS and IOS XE you can pick a strong hash type, for example enable algorithm-type scrypt secret <password> (Type 9).
When both are set
If a router has both lines, it uses only the enable secret and ignores the enable password (the password is a leftover for very old software). IOS even warns you if you try to make the two the same. So the rule is simple: configure enable secret, and remove enable password with no enable password.
Try it yourself
In Cisco Packet Tracer, set enable password cisco on a router and run show running-config: the password is readable. Now add enable secret class, log out, and type enable: only class works. Look at the config again and compare the two lines. Finally, turn on service password-encryption and notice that the enable password becomes a Type 7 string, which is hidden but not truly protected.
Good to know
- CCNA 5.3 covers configuring and verifying device access control with local passwords (EP55 covers SSH vs Telnet, EP61 AAA, EP62 password policy).
enable passwordis plain text unlessservice password-encryptionis on, and then it is only weak, reversible Type 7.enable secretis a one-way hash: Type 5 (MD5) on older IOS; current IOS and IOS XE support stronger types such as Type 9 (scrypt).- When both are configured, only the enable secret is used.
- A hash can still be guessed by brute force if the password is weak, so "nobody can read it back" means it can't be decoded directly. Use a long password.
- "Sticky note vs fingerprint scanner" is the analogy. The passwords (
apple,mango) and the hash on screen are made-up examples.
For CCNA learners
CCNA exam topic 5.3 covers device access control using local passwords. Know that enable secret is hashed and enable password is not, that service password-encryption uses reversible Type 7, and that the secret takes priority when both exist.
Answer to the comment question
8 characters. When both are set, the router uses only the enable secret and ignores the enable password. The secret is twice as long as the four-character password, so you type 4 × 2 = 8 characters to get into privileged mode.
Test your knowledge
Quick quiz: "enable secret vs enable password"
4 multiple-choice questions. Pick one answer for each, then check how you did.
Sources
- Cisco, "Cisco IOS Password Encryption Facts" (tech note 107614): enable password is plain text or weak, reversible Type 7; enable secret is stored as a one-way hash; when both are set, the secret is used
- Cisco Community, "Understanding the differences between the Cisco password / secret types": the stored password and secret types compared, from reversible to strong one-way hashes
- Cisco, "CCNA 200-301 v1.1 exam topics": 5.3 configure and verify device access control using local passwords
Video transcript
A router can have two passwords for the same door. Why is only one safe?
Both guard privileged mode, the level where you can change the whole configuration.
One is like a door code on a sticky note. The other is like a fingerprint scanner.
Enable password sits in the config in plain text. Anyone who sees a backup or screenshot can read it.
Enable secret stores only a scrambled, one-way hash. The router checks what you type against it, but nobody can read the original back.
If both are set, the secret wins. So use enable secret only.
Enable password is four characters long. Enable secret is twice as long. How many characters do you type to get in? Comment your answer below!
That's your byte.
More from Network Bytes
- EP93"Layer 3 switches and SVIs"
- EP94"OSPF router ID: how it's chosen"
- EP96"Wildcard masks"
- EP97"The native VLAN"