check logged-in user

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 user are running on the server.

Check Out : How To Change Owner And Group of Directory In Linux

This is very important to find out who’s logged-in without authorisation on the server. you can use monitoring tools to keep an eye on all the infrastructure.

w command is used to show logged-in user and what they’re doing on the systems. there’re many arguments available with ‘w’ command. This information written in /var/log/utmp

w command

Last command will print the successful entries from the past attempts made by 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 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.


Please enter your comment!
Please enter your name here

15 − two =