Config Router

  • Google Sheets
  • CCNA Online training
    • CCNA
  • CISCO Lab Guides
    • CCNA Security Lab Manual With Solutions
    • CCNP Route Lab Manual with Solutions
    • CCNP Switch Lab Manual with Solutions
  • Juniper
  • Linux
  • DevOps Tutorials
  • Python Array
You are here: Home / Juniper / How to check the current number of SSH sessions

How to check the current number of SSH sessions

June 13, 2016 by Marques Brownlee

This article provides information on how to check the number of current SSH sessions.

At times, when using SSH to logon to a Junos device, the connection fails; even when the IP address is reachable. This may be due to the SSH session limitation being exceeded.

A default SSH session limitation, which has a default value of 75, is present in Junos OS release 12.2. This can be modified via the configuration under the [system – service – ssh – connection-limit] hierarchy.

If the number of the current SSH sessions (including the active and stale sessions) is equal to the maximum limitation, a new SSH session will not be established.

Even though it is possible to display the number of active sessions being carried by the chassis, (via the show system users command), stale sessions might still exist and they cannot be displayed in the output of the command. You can use the following shell command to check how many SSH sessions are currently being carried by the chassis:

% ps aux | grep sshd
root 99875 81.1 0.1 6252 2648 ?? Rs 8:15PM 2:17.92 sshd: test@notty (sshd)
root 79158 0.0 0.1 6096 2540 ?? Is 4:34PM 0:00.02 sshd: test@notty (sshd)
root 79250 0.0 0.1 6096 2540 ?? Is 4:34PM 0:00.02 sshd: test@notty (sshd)
root 79307 0.0 0.1 6096 2540 ?? Is 4:34PM 0:00.02 sshd: test@notty (sshd)
root 79366 0.0 0.1 6096 2540 ?? Is 4:34PM 0:00.02 sshd: test@notty (sshd)
root 79710 0.0 0.1 6096 2540 ?? Is 4:35PM 0:00.02 sshd: test@notty (sshd)
<snipped>

Each sshd line represents one SSH session. By checking the result, you can tell how many SSH sessions are being carried by this chassis. To release some of these SSH sessions, use the kill command to terminate them by using the corresponding PID:

%kill -9 PID

By releasing some of the existing (possibly stale) SSH sessions, new SSH sessions can be successfully established.

Related

Filed Under: Juniper

Recent Posts

  • How do I give user access to Jenkins?
  • What is docker volume command?
  • What is the date format in Unix?
  • What is the difference between ARG and ENV Docker?
  • What is rsync command Linux?
  • How to Add Music to Snapchat 2021 Android? | How to Search, Add, Share Songs on Snapchat Story?
  • How to Enable Snapchat Notifications for Android & iPhone? | Steps to Turn on Snapchat Bitmoji Notification
  • Easy Methods to Fix Snapchat Camera Not Working Black Screen Issue | Reasons & Troubleshooting Tips to Solve Snapchat Camera Problems
  • Detailed Procedure for How to Update Snapchat on iOS 14 for Free
  • What is Snapchat Spotlight Feature? How to Make a Spotlight on Snapchat?
  • Snapchat Hack Tutorial 2021: Can I hack a Snapchat Account without them knowing?

Copyright © 2025 · News Pro Theme on Genesis Framework · WordPress · Log in