How to disconnect a telnet user from a switch

Unanswered Question
May 22nd, 2008
User Badges:


I've run out of telnet sessions that I can use to connect to a 3560 switch. When I run "show users" I get:

#sh users

Line User Host(s) Idle Location

1 vty 0 idle 1d21h

2 vty 1 idle 04:00:01

3 vty 2 00:00:00

4 vty 3 00:00:00

* 5 vty 4 idle 00:00:00

Interface User Mode Idle Peer Address

How do I disconnect these users. I've tried disconnect but I think I'm getting the syntax wrong given the above information. An exmplae with the above results included would be good.

Thanks in advance


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
philiechang Thu, 05/22/2008 - 07:33
User Badges:

Clear line vty x, where x is the number on the right of vty. Here's an example:

RT-3825#clear line vty 0



dan_track Thu, 05/22/2008 - 07:59
User Badges:

Thanks for that.

Why doesn't the disconnect command work?


philiechang Thu, 05/22/2008 - 08:24
User Badges:

The disconnect command is used to disconnect your current connections to various terminal connections when you use an async/term server.

Here's an example:


Closing connection to INTERNET-1 [confirm]


Joseph W. Doherty Fri, 05/23/2008 - 03:35
User Badges:
  • Super Bronze, 10000 points or more

Another poster has provided how to clear the vty line, but you might also want to consider how to minimize this situation arising. Often, Cisco devices can enable idle session timers and/or TCP keepalives.

kstiver Fri, 05/23/2008 - 03:54
User Badges:

I have the same problem on a 3560 switch, because I did not have the 'session-timeout' configured on the vty line. Now the problem is that the 'clear line vty 3' is not disconnecting the session. Any ideas?


Richard Burts Fri, 05/23/2008 - 11:07
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN


Is it possible that there is confusion about the line number and the vty line number? If you do a show line it will show the line numbers which are different from vty 0, 1, etc.

So which number did you use when you attempted the clear line? And did you do clear line or did you do clear line vty ?

Perhaps it would help us to understand the issue and to give better advice if you would post the output of show line, and the command that you attempted to clear the vty.



kstiver Sat, 05/24/2008 - 06:16
User Badges:

Yes, I can see that there is a difference between the line # and the vty #. Following this output of 'who':

Line User Host(s) Idle Location

14 vty 13 idle 6w1d ###.###.###.###

I would enter the command:

clear line vty 13, or

clear line 14

neither being effective.


(ultimately I rebooted the switch, because I couldn't wait for another solution...but I'd still like to know what went wrong, for future reference...)

(This is no


This Discussion