YLearn is correct in that you are not properly disconnecting the session. If I understand the way you have this configured (password on the line, login local
on the line, and no global username and password configured), when you properly disconnect the session by exit
, you will find yourself locked out of the router. If you use login local
it doesn't look for the password under the line configuration.
Telnet, Console and AUX Port Passwords on Cisco Routers Configuration Example
Configure Passwords on the Line
To specify a password on a line, use the password command in line
configuration mode. To enable password checking at login, use the
login command in line configuration mode.
Note: To find additional information on the commands used in this document, use the Command Lookup Tool (registered customers only).
Configuration Procedure
In this example, a password is configured for all users attempting to
use the console.
From the privileged EXEC (or "enable") prompt, enter configuration
mode and then switch to line configuration mode using the following
commands. Notice that the prompt changes to reflect the current
mode.
router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
router(config)#line con 0
router(config-line)#
Configure the password, and enable password checking at login.
router(config-line)#password letmein
router(config-line)#login
Exit configuration mode.
router(config-line)#end
router#
%SYS-5-CONFIG_I: Configured from console by console
Note: Do not save configuration changes to line con 0 until your ability to log in has been verified.
Note: Under the line console configuration, login is a required configuration command to enable password checking at login. Console
authentication requires both the password and the login
commands to work.
This is how to use login local
command:
Configure Local User-Specific Passwords
To establish a username-based authentication system, use the
username command in global configuration mode. To enable password checking at login, use the login local command in line
configuration mode.
Configuration Procedure
In this example, passwords are configured for users attempting to
connect to the router on the VTY lines using Telnet.
From the privileged EXEC (or "enable") prompt, enter configuration
mode and enter username/password combinations, one for each user for
whom you want to allow access to the router:
router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
router(config)#username russ password montecito
router(config)#username cindy password belgium
router(config)#username mike password rottweiler
Switch to line configuration mode, using the following commands.
Notice that the prompt changes to reflect the current mode.
router(config)#line vty 0 4
router(config-line)#
Configure password checking at login.
router(config-line)#login local
Exit configuration mode.
router(config-line)#end
router#
%SYS-5-CONFIG_I: Configured from console by console
Note: In order to disable auto Telnet when you type a name on the CLI, configure no logging preferred on the line that is used.
While transport preferred none provides the same output, it also
disables auto Telnet for the defined host that are configured with the
ip host command. This is unlike the no logging preferred command, which stops it for undefined hosts and lets it work for the
defined ones.