Hone

Lessons · Network switches · the enable secret

A password on the way in

enable secret sets the password that guards privileged mode, and it is stored hashed rather than in plain text.

Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.

What it is for

Without it, anybody who reaches the console owns the switch. With it, reaching the console gets you a read-only prompt and nothing else.

How to think about it

Set it early, write it down where your team can find it, and never use `enable password`, whose value sits in the configuration in the clear.

Worked example

enable
No password yet, so this just works. That is the problem.
configure terminal
Into configuration mode.
enable secret Sw1tch-Room
From now on, enable asks.
end
Out to Switch#.
show running-config
The line is there. On real hardware the value is stored as a hash, which is the whole reason to use secret rather than password.
disable
Back down to Switch>, to see what somebody arriving at the console now meets.

Your turn

Protect privileged mode with the password Sw1tch-Room.

enable  Sw1tch-Room

The trap

Setting the password and not saving. A reboot brings back a switch with no password on it, and nothing tells you.

Practise the enable secret on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.