Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[ScreenOS] How to delete or clear a Telnet or SSH session



Article ID: KB5544 KB Last Updated: 16 Sep 2020Version: 6.0

Is there a way to disconnect Telnet or SSH sessions that may be hung on the firewall?


Problem or goal:

  • Clear hung console sessions
  • Clear hung Telnet sessions
  • Clear hung HTTP sessions
  • How do I delete a different telnet session?
  • Clearing Telnet and SSH sessions
  • How to disconnect Admin sessions
  • How to disconnect Telnet or SSH sessions
  • Is there a way to disconnect Admin sessions from the firewall?
  • Is there a way to disconnect Telnet or SSH session that may be hung on the firewall?
There are two possible ways to clear the admin or management sessions:
  • Use the 'get admin' and 'clear admin' commands.   To list the currently connected Admins, use the command:
    FW-> get admin user login
    Then clear the desired admins with the command:
    FW-> clear admin name <name>

  • Use the 'get socket' and 'clear socket' commands. 
    To clear a Telnet or management session, look up the TCP socket id for that process and then clear it.

    Example:  Assume there is a telnet session that should be deleted.  To obtain a list of telnet and other management sockets, log in to the Command Line Interface, and issue the command:

    fw-> get socket

     Socket  Type   State      Remote IP         Port    Local IP         Port 
          0  tcp    listen              0            23
          2  tcp    listen              0          8754
          3  tcp    listen              0          4444
          4  tcp    listen              0          1100
         41  tcp    open     15400    58473
         57  tcp    open      17410       23
         61  tcp    open      17439     1100
        100  udp    close              0           161
        101  udp    close              0            67
        102  udp    close              0      500
        103  udp    close              0     5001
        104  udp    close              0             0

    This table shows which sockets are connected to the firewall. In this example, the local IP is the NetScreen firewall with sockets connected to IP address There is also a socket to destination port 23 (Telnet) from source IP  To delete this socket, issue the command:

    fw->  clear socket id 57
Note: Only TCP sockets can be cleared; UDP sockets cannot be cleared as its connectionless
Modification History:
2020-09-11: Article reviewed for accuracy; minor non-technical changes done.
Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search