How Do You Monitor Logins on a Linux System?

0
7
Asked By CuriousCat42 On

I've recently noticed some login entries that didn't seem to match my expectations on a Linux box. I ran the 'last -a' command to review the logins, but nothing stood out as obviously wrong. Still, it got me thinking about how to differentiate between what's normal and what's not when it comes to system logins. How do you usually monitor and verify logins on your Linux system?

5 Answers

Answered By CommandLineHero On

I also check the audit log and use the `w` command to see who is logged in. It helps to get a complete view of the current user activity.

Answered By TechSavvy101 On

I usually check the `/var/log/secure` file; it's my go-to for verifying logins. It's definitely the first place I look.

SystemNerd99 -

Yeah same here, `/var/log/secure` is usually my first stop too!

Answered By NetworkJunkie88 On

If the situation is more complex, I send logs to Elastic, then filter and visualize them in Kibana. It's important to get the logs off the server quickly since malicious actors can wipe login history. Also, setting up anomaly detection in Elastic can help catch unusual activity.

CyberAnalyst77 -

Exactly! It's crucial to have your logs stored somewhere safe. Some malware, like Adore, can mess with login activity.

Answered By LogWatcher On

Don't forget to check `lastb` for failed login attempts as well! It's useful for catching unauthorized access attempts.

Answered By ScriptingSavvy On

Sometimes when jumping between servers with commands like `ssh -J`, those activities don't always show up in `who`, `w`, or `last`, but you'll see them in the sshd logs.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.