Cyberlium
Cyberlium
Cyberlium on Android·Google Play Store

Learn cybersecurity with hands-on labs and AI mentor support on your phone.

Mod 6 · Les 2/5
In progress
Module 6•Lesson 2 of 5•⏱️ 15 min read•Beginner+39 XP

Linux Syslog

journalctl and /var/log — read syslog on YOUR lab Linux host only.

Linux Syslog
00:00/02:48

Visual · t16_linux_syslog

Linux logs via journald and text files. Original Cyberlium.

Every sshd failure leaves a line — if you know where to read on your own box.

Modern Linux distros use systemd-journald (journalctl) plus traditional files under /var/log (auth.log, secure, messages). Learn priority levels, unit filters, and tail/grep hygiene on YOUR lab Linux VM ($LAB). Defenders correlate sshd, sudo, and PAM lines — never scrape /var/log from servers you do not own or lack written permission to monitor.

1. journalctl basics

journalctl -u sshd --since today; -p err for priority filter; -b for current boot.

Persistent journal requires configuration — note if your lab VM resets each session.

Command guide

Try these commands — journalctl basics

═══ TOOLS & WEBSITES ═══ Browse / read these (authorized learning only — stay in YOUR lab / program scope)

Linux syslog — https://www.rsyslog.com/doc/ rsyslog — https://www.rsyslog.com/

═══ INSTALL ═══

Linux (Debian/Ubuntu):

macOS:

Windows:

═══ LINUX / macOS ═══

Command — copy this

journalctl -n 30 --no-pager 2>/dev/null | head -20
grep -hE 'sshd|sudo|CRON' /var/log/auth.log /var/log/syslog 2>/dev/null | tail -10 || journalctl -n 40 --no-pager | tail -10

Primary tools to practice this lesson: journalctl, grep. Reference sites: Linux syslog (https://www.rsyslog.com/doc/); rsyslog (https://www.rsyslog.com/). Run every command in the box — install first, then the usage lines — only on YOUR lab / program scope.

2. Classic log files

Debian/Ubuntu: /var/log/auth.log. RHEL: /var/log/secure. Both may capture sshd and sudo.

Rotate and retention policies matter for investigations — covered in earlier modules.

3. Scope boundary

Read logs only on $LAB Linux you control. No SSH to classmate VMs for 'log homework.'

Copying production log snippets into public repos violates privacy — redact in notes.

4. What you ship: Linux syslog vocabulary

journalctl filter example + auth log path + $LAB-only rule.

5. What you record before the next lesson

journalctl and auth log paths on lab distro.

6. Wrong vs right: stranger hosts vs YOUR lab hosts

Worked failure — same MSF word, opposite target. Right never needs a café Wi-Fi or classmate laptop.

  • Wrong: SSH to a shared lab server without authorization to harvest auth.log.
  • Right: Name journalctl and auth log paths. Next: auth failures.
Hands-on Exercise

Mission: Linux syslog notes

1) Run journalctl -u sshd -n 20 on $LAB. 2) Locate auth.log or secure path on your distro. 3) Write NEVER read stranger host logs.

Pro Tip

Stuck? Ask Cyberlium AI Mentor

Ask Mentor: “auth.log vs secure on my distro?”

Practice QuizQuestion 1
Multiple choice
Q1

APPLY: journalctl -u sshd shows:

Practice QuizQuestion 2
True or False
Q2

APPLY: True or False: Reading /var/log on hosts you do not own is homework.

Practice QuizQuestion 3
Multiple choice
Q3

APPLY: Auth failures often appear in:

←Previous: Windows Events
Answer 3 practice quiz questions to unlock XP reward. (0/3 answered)
Skip quiz & read next →