cisco hands-on experience


How to clear line vty

To clear a vty line (telnet/ssh) connection on a cisco device you have to know, how to interpret the ‘sh line’ output.
To show the line output you can choose the following line-commands.

show commands

  • CAT_6500#sh whoami
  • CAT_6500#sh users
  • CAT_6500#sh line


With the ‘sh whoami’ command you can see on which vty line you are connected.
I’ am connected on Line 2.

sh whoami
CAT_6500#sh whoami

Comm Server “CAT_6509”, Line 2 at 9600bps. Location “”

With the ‘sh users’ command you see, that i was connected at Line 2 vty.
The asterisk in front of the line show the active line.

sh users
CAT_6500#sh users
Line        User       Host(s)                  Idle           Location
   1 vty 0     user1      idle                 00:28:33    10.11.12.13
*  2 vty 1     user2      idle                 00:00:00   10.11.12.13
   3 vty 2     user3      idle                 00:11:02    10.11.12.13

Interface      User        Mode              Idle     Peer Address

With the ‘sh line’ command you see all active and passive lines. The output shows all type of possible
connections.

sh line
CAT_6500#sh line
Tty Typ     Tx/Rx    A Modem  Roty AccO AccI   Uses   Noise  Overruns   Int
     0 CTY              –    –      –    –    –      0       0     0/0       –
*    1 VTY              –    –      –    –    –    615       0     0/0       –
*    2 VTY              –    –      –    –    –    155       0     0/0       –
*    3 VTY              –    –      –    –    –     46       0     0/0       –
     4 VTY              –    –      –    –    –     11       0     0/0       –
     5 VTY              –    –      –    –    –      2       0     0/0       –
     6 VTY              –    –      –    –    –      3       0     0/0       –
     7 VTY              –    –      –    –    –      1       0     0/0       –
     8 VTY              –    –      –    –    –      0       0     0/0       –
     9 VTY              –    –      –    –    –      0       0     0/0       –
    10 VTY              –    –      –    –    –      0       0     0/0       –
    11 VTY              –    –      –    –    –      0       0     0/0       –
    12 VTY              –    –      –    –    –      0       0     0/0       –
    13 VTY              –    –      –    –    –      0       0     0/0       –
    14 VTY              –    –      –    –    –      0       0     0/0       –
    15 VTY              –    –      –    –    –      0       0     0/0       –
    16 VTY              –    –      –    –    –      0       0     0/0       –
  • If you want to clear line 3 vty, you have to execute the following command.
    CAT_6500#clear line vty 2.
    The Tty column begin at vty with the digit 1 to 16.
    But the clear line vty command begins from 0 to 15.
    Clearing line 3 vty -> choose ‘clear line vty 2’
  1. Hideki Reply

    Articles like this really grease the shafts of knewledgo.

    • Jacob Reply

      thx!

  2. Anand Reply

    If your artleics are always this helpful, “I’ll be back.”

  3. AliseOJoaquin Reply

    I was suggested this blog by my cousin. I am not sure whether this post is written by him as no one else know such detailed
    about my problem. You are amazing! Thanks!

Leave a Reply to Jacob Cancel reply

*

captcha *