Monitoring Linux through the use of commands offers several advantages. First of all, it allows us to have more precise and real-time control over the operating system, thus facilitating the detection and resolution of performance or security problems. In addition, system monitoring allows us to have a detailed view of system resources, such as CPU usage, memory and/or disk usage, thereby optimizing performance. With this, we will also obtain information on the status of the running processes, thereby being able to identify moments of error..
If we must administer Linux systems, one of the most essential tasks to carry out is to supervise the logins since with this we determine who and when accessed the system and it is ideal for monitoring unauthorized changes either in the system itself or in any of its components. , TechnoWikis brings this tutorial to teach you the simple way to check who has logged into your system and thus rule out possible unauthorized access.
To stay up to date, remember to subscribe to our YouTube channel!
SUBSCRIBE ON YOUTUBE
How to Monitor Linux Log
Step 1
The first step we open the terminal in this case will be Ubuntu, there we will execute the following command:
sudo less /var/log/auth.log
Step 2
We enter the password and we will have access to the following. We will see full details of each login, we exit this screen with the letter q.
Step 3
Now it will be possible to use another simple command for this action to see the logs, we enter the following command in the terminal:
last
Step 4
We see the details with date and time of login.
step 5
Finally it will be possible to use the “lastlog” command to see all the lines with the status of whether or not they have logged into the system:
step 6
When someone has accessed we see when they did:
These options are simple but practical to see the login log in Linux..