Watch on Instagram

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.

Posted · About a 1 minute watch, 3 minute read · Take the quiz

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 password is plain text unless service password-encryption is on, and then it is only weak, reversible Type 7.
  • enable secret is 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.

1Where does enable password appear in the config?
2How does the router check an enable secret?
3A router has both enable password and enable secret set. Which one does it use?
4What does service password-encryption do to the enable password?

Sources

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

All Network Bytes lessons