See logged in users on CISCO IOS and disconnect them.

So you may want to see who else is accessing the switch or router that you’re on. Sometimes this is because you get a write error when trying to save the running config. The error would be something like:

startup-config file open failed (Device or resource busy)

This is because another user is utilizing the running config. It could even be a timed out user that didn’t disconnect yet. So what can we do? First of all lets find the right command. The command you want is the ‘systat’ command, which is used to “Display information about terminal lines” of the active device. It may take a few moments to run, and will show you something like this:

ds01-r1-dn-mco#systat
    Line       User       Host(s)              Idle       Location
   1 vty 0     master     idle                 2w4d       98.198.xxx.xxx
*  2 vty 1     master     idle                 00:00:18   98.198.xxx.xxx

  Interface      User        Mode                     Idle     Peer Address

ds01-r1-dn-mco#

So in our example we see two instances of the username “master” logged into the switch from “98.198.xxx.xxx”, the IPs are obfuscated for my security ;-)! We see that the first line, vty 0, is idle for 2 weeks and 4 days. That’s the culprit! So what do we do if we want disconnect the user from his IOS line session? To kick the user off we can drop his line via the ‘clear line’ command. Like so:

ds01-r1-dn-mco#clear line vty 0 
[confirm]y [OK]
ds01-r1-dn-mco

You will be asked to confirm as this process happens. Once you’ve done that you can now write the config or do whatever else you need to do while knowing you’re the one in control of the switch.