Expertise level: Easy
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:
- Login with SSH as root.
- 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
- 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.