How To Check Currently Logged-In User In Linux System

0
94

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 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

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here