How To Check Currently Logged-In User In Linux System

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.

Check Out: How To Change Owner And Group of Directory In 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

linux check login history

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.

last command

Check Out: How To Check Kali Linux Version Using Command Line

You can also use ‘stat‘ command to check when the timestamp of the file,

stat /var/log/wtmp

who -a command will show you who’s logged-in on the systems.

whoami command

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

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment