Cisco - Enable Password Protection

Introduction:

All of the commands were tested on ‘Cisco Packet Tracer’.


Simulating a Console Connection

2021-09-17_080606

2021-09-17_080631


2021-09-17_081606


Device Renaming (Option)

Router>enable
Router#configure terminal
Router(config)#hostname R1
CommandDescription
enableEnter privilege EXEC mode, which provides access to all the commands in the Cisco IOS software.
configure terminalEnter global configuration mode, which provides access to the configuration commands that affect the entire network device.
hostname R1Set the hostname of the device to “R1”.

Setup Password

R1(config)#enable secret ccna

This command sets the enable secret password to “ccna”. The enable secret password is used to control access to privileged EXEC mode.

R1(config)#line console 0
R1(config-line)#password cisco
R1(config-line)#login	#tell the device use password to connect the console
R1(config-line)#exit
R1(config)#service password-encryption	#encryption the password
R1#exit
CommandDescription
line console 0Configure the settings for the console port.
password ciscoSet the password for the console port to “cisco”.
loginEnable login authentication on the console port.
exitExit from the current configuration mode.
service password-encryptionEncrypt all plaintext passwords, including the enable secret password and the console port password.
R1(config)#exit
R1#write memory
CommandDescription
write memorySave the configuration changes to the device’s non-volatile memory.
exitExit from the privilege EXEC mode and return to user EXEC mode.

Verify Login Via Password

2021-09-17_085014

User Access Verification

Password: cisco

R1>enable

Password:ccna


Create Local Account

2021-09-17_085225

Create Console’s Account and Password

R1#enable
R1#configure terminal
R1(config)#username cisco secret ccna
R1(config)#line console 0
R1(config-line)#login local
R1(config-line)#end
R1>logout
CommandDescription
username cisco secret ccnaCreate a user account with the username “cisco” and a secret password of “ccna”.
line console 0Configure the settings for the console port.
login localEnable local authentication for login on the console port.
endExit from the current configuration mode and return to privileged EXEC mode.
logoutLogout from the current session and terminate the connection to the device.

Verify Local Account Login

2021-09-17_085516

User Access Verification

Username:cisco

Password:ccna

R1>enable

Password:ccna


Remove Password Protection

R1>enable
R1#configure terminal
(Config)#no enable secret
CommandDescription
no enable secretRemove the enable secret password from the device configuration.
R1(config)#no username cisco
CommandDescription
no username ciscoRemove the user account with the username “cisco” from the device configuration.

Setup the console port to time out

 (config)#line console 0
 (config-line)#exec-time 00 00
 (config-line)#exec-time 02 30
CommandDescription
line console 0Configure the settings for the console port.
exec-time 00 00Set the console port to never time out.
exec-time 02 30Set the console port to time out after 2 hours and 30 minutes of inactivity.

Prevents logging messages from interrupting command entry

 (config)#line console 0
 (config-line)#logging synchronous
CommandDescription
logging synchronousEnable synchronous logging mode on the console port.

Reference: