Posted: May 14th, 2016
To get information regarding the users who are currently connected to the server, you can use the "w" command.
Please follow these steps to get the information:
1) Login with SSH as root.
2) Type the command: w
You will be shown an output having many columns.
[root@server ~]# w
17:14:10 up 19:08, 0 users, load average: 0.22, 0.44, 0.34
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
[root@server ~]#
> USER Field shows you the username of the connected user.
> TTY field shows which terminal the user is using.
> The IP address or hostname of the connected users will be listed under column FROM.
> WHAT field shows which command the user is currently running.