5.3 Configure and verify local-password protection of device access
CCNA 200-301 v1.1 · 5.0 Security Fundamentals
The first line of defence on a router or switch is its own login: who can reach the CLI from the console and the network, and who can reach privileged mode. For the CCNA you protect each access point (console, VTY, privileged EXEC) with passwords or local users, store them hashed, and add login protection.
What you must know
- Protect privileged EXEC with
enable secretand explain why it beatsenable password. - Protect the console and VTY lines with a line password or a local user database.
- Hide clear-text passwords with
service password-encryptionand know its limits. - Add login protection: block after failed attempts, and log out idle sessions.
- Add a warning banner.
Privileged mode and lines
enable secret Ena8le!Secret
!
line console 0
password C0nsole!
login
exec-timeout 5 0
!
username admin privilege 15 secret Adm1n!Pass
line vty 0 15
login local
transport input ssh| Command | Stored as | Use |
|---|---|---|
| enable password | Clear text (type 7 with encryption) | Avoid |
| enable secret | Hash (type 5 MD5, 8 PBKDF2 or 9 scrypt) | Always |
| username … password | Clear text (type 7 with encryption) | Avoid |
| username … secret | Hash | Always |
If both enable password and enable secret exist, the secret is used. login on a line uses the line's password; login local uses the usernames.
Encryption, lockout and banners
service password-encryption
security passwords min-length 10
login block-for 120 attempts 3 within 60
banner motd # Authorised access only. Activity is logged. #Commands
show running-config | section line | The line settings: passwords, login method and transport. |
show running-config | include secret|password | Which passwords are hashed and which are not. |
show login | Login block settings and whether the device is in quiet mode. |
show users | Who is logged in, on which line, and for how long. |
Exam traps
enable secretwins overenable passwordwhen both exist.loginwithout a password on the line refuses all logins ("Password required, but none set").- Type 7 passwords can be reversed; type 5, 8 and 9 secrets cannot.
exec-timeout 0 0disables the idle timeout: fine in a lab, not in production.
Check yourself
- A router has
enable password ciscoandenable secret class. Which opens privileged mode? class, the secret.- What does
service password-encryptionprotect against? - Casual viewing of the configuration. Type 7 can be decoded easily.
- How do you block logins for two minutes after three failures in one minute?
login block-for 120 attempts 3 within 60.
Labs
Try it live: Secure device access: passwords, SSH, CDP and LLDP
More topics in 5.0 Security Fundamentals
- 5.1 Define the basic security vocabulary: threat, vulnerability, exploit, mitigation
- 5.5 Describe site-to-site and remote-access IPsec VPNs
- 5.6 Configure and verify access control lists (ACLs)
- 5.7 Configure and verify DHCP snooping, DAI and port security
- 5.8 Compare the roles of authentication, authorization and accounting
- 5.9 Describe how WPA, WPA2 and WPA3 differ
- 5.10 Configure and verify a WPA2-PSK WLAN in the controller GUI