cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
29781
Views
10
Helpful
7
Replies

How to disconnect a telnet user from a switch

dan_track
Level 1
Level 1

Hi

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 10.11.11.29

2 vty 1 idle 04:00:01 10.11.11.29

3 vty 2 10.11.3.2 00:00:00 10.11.11.29

4 vty 3 10.11.3.5 00:00:00 10.11.11.2

* 5 vty 4 idle 00:00:00 10.11.3.5

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

Dan

7 Replies 7

philiechang
Level 1
Level 1

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

RT-3825#clear line vty 0

[confirm]

[OK]

Thanks for that.

Why doesn't the disconnect command work?

Dan

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:

SF-TERMSVR-1#disconnect

Closing connection to INTERNET-1 [confirm]

SF-TERMSVR-1#

Joseph W. Doherty
Hall of Fame
Hall of Fame

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.

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?

Thanks,

Kevin

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.

HTH

Rick

HTH

Rick

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.

Thanks.

(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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco