cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
467
Views
5
Helpful
3
Replies

CLI command

nerraw774
Level 1
Level 1

What command can I use to view who log into a switch.

3 Replies 3

jdamon113
Level 1
Level 1

sh users

As jdamon113 says, the show users command will tell you which users are currently logged in, including the user running the command indicated with an asterisk (*).

c1kv-1#sh users
    Line       User       Host(s)              Idle       Location
   1 vty 0     admin      idle                 00:02:27 192.168.1.78
*  2 vty 1     admin      idle                 00:00:09 192.168.1.78

 

It's not clear from the question, but if you need to know which user has logged in / out and when, you can use the login on-success and login on-failure commands to generate a SYSLOG message. These commands were added as part of the Cisco IOS Login Enhancements.

These are the commands in the configuration:

c1kv-1# sh run | in ^login
login on-failure log
login on-success log

 

And these are the SYSLOG messages generated:

*Sep  6 16:32:56.188: %SEC_LOGIN-5-LOGIN_SUCCESS: Login Success [user: admin] [Source: 192.168.1.78] [localport: 22] at 16:32:56 UTC Sun Sep 6 2015
*Sep  6 16:33:21.346: %SYS-6-LOGOUT: User admin has exited tty session 1(192.168.1.78)
*Sep  6 16:33:30.353: %SEC_LOGIN-4-LOGIN_FAILED: Login failed [user: admin] [Source: 192.168.1.78] [localport: 22] [Reason: Login Authentication Failed] at 16:13:30 UTC Sun Sep 6 2015

Regards

Thank you for your response.

 

Review Cisco Networking for a $25 gift card