How To List Currently Logged In Users In Linux?
I have Linux servers. There is a lot of different remote connection services like ssh, telnet, vnc, X11, konsole etc. I want to learn who is logged currently. And get details like connection way, connection time IP address etc. These information may become very crucial. There different commands to get this information.
w Command For Connected Users
w is very interesting command which can provide information about currently logged in users. It provides extra information like
Login Time etc.
- USER is the username
- TTY is connection type
- FROM is ip address of client
LOGINprovides when the user logged in.
WHATprovides the starting process of the session which is
XFCEdesktop in this example
who Command To Get Connected Users
who command provides similar information like
w command but it is simpler and more readable then
Userwill display the user name which is
ismailin this case.
TTYwill display terminal number which is
tty1in this example
Get All Logins and Login Screens Waiting For User
We can get logged in users and get login screen with who commands -a parameter. This will provide more detailed information like other users.
$ who -a