Login Command on CISCO Router/Switch

Command

Login

Use

Enables authentication for virtual terminal connections to router. Contrary to what it may sound like, using the no login command will actually disabled authentication to the vty line. This means that a user will not be prompted for a password when trying to log in to the virtual terminal.

Syntax

Router(config-line)#login

Example

In this example, login is enabled for virtual terminal access on R2. Notice that a password is also set before using the login command.

R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#line vty 0 4
R2(config-line)#password cisco
R2(config-line)#login

The configuration for vty 0 4 is shown with login enabled.

R2(config-line)#do show run | sec vty
line vty 0 4
password cisco
login
transport input telnet ssh

A telnet session is initiated from R3 to R2. A prompt is shown asking for the password that was just set.

R3#telnet 10.2.2.2
Trying 10.2.2.2 … OpenUser Access Verification
Password: *****
R2>

Here’s another example when using no login for vty 0 4.

R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#line vty 0 4
R2(config-line)#no login

The running config is shown for vty 0 4, with no login. Also note that the password is still set, even though login isn’t.

R2(config-line)#do show run | sec vty
line vty 0 4
password cisco
no login
transport input telnet ssh

A telnet session is initiated from R3 to R2. Notice that, this time, no prompt is shown asking for a password.

R3#telnet 10.2.2.2
Trying 10.2.2.2 … OpenR2>

Related Articles

Leave a Reply

avatar