As System Admin, you need to know who’s logged-in on the system and what they’re doing here. Let’s see how to check currently logged-in user and after making this little security, we can keep an eye on what commands the user is running on the server. You can check the current login and last login date of the user using history in the Linux.
How To Check Currently Logged-In User In Linux System:
This is very important to find out who’s logged-in without authorization on the server. you can use monitoring tools to keep an eye on all the infrastructure.
w command is used to show logged-in users and what they’re doing on the systems. there’re many arguments available with ‘w’ command. This information written in /var/log/utmp
The last command will print the successful entries from the past attempts made by the user and last reads from a log file /var/log/wtmp.
You can also use ‘stat‘ command to check when the timestamp of the file,
who -a command will show you who’s logged-in on the systems.
You can also use users, who and whoami commands.
YouTube Link :
That’s it. current login user linux linux check login history linux last login date check user login