Objective. Students locate, read, and analyze key Linux log files to identify security events and indicators of compromise.
This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
Every meaningful event on a Linux system — a user login, a failed authentication attempt, a kernel error, a package installation — is recorded in a log file. For a security analyst, logs are the primary evidence trail. The CompTIA CySA+ exam tests your ability to analyze log data under the Security Operations and Monitoring domain, and the ISC2 CC credential expects you to understand incident response fundamentals, which depend heavily on reading logs accurately.
Log analysis is a core daily task in Security Operations Centers (SOCs). Learning to extract, filter, and correlate log data by hand builds the mental model you need to operate SIEM tools effectively.
On Debian and Ubuntu-based Linux systems, most log files live in /var/log. Know what each file records:
On systems using systemd, the journalctl command queries the binary journal, which can include all of the above plus boot messages, service start/stop events, and more. Always check both traditional text logs and the journal during an investigation.
grep filters lines by pattern. To find all failed SSH login attempts in auth.log:
```
grep "Failed password" /var/log/auth.log
```
awk lets you extract specific fields. SSH failure lines contain the source IP in a predictable position. For example:
```
grep "Failed password" /var/log/auth.log | awk '{print $11}'
```
cut extracts columns by delimiter. Combine it with sort and uniq to count unique IPs:
```
grep "Failed password" /var/log/auth.log | awk '{print $11}' | sort | uniq -c | sort -rn
```
This pipeline prints each unique source IP alongside the count of failures, sorted highest to lowest — a fast way to spot a brute-force source.
journalctl filters the systemd journal. To view SSH-related events since midnight:
```
journalctl -u ssh --since today
```
Add -r to reverse chronological order (newest first) and -n 50 to limit output to 50 lines.
When an incident is suspected, your job is to build a timestamped narrative of what happened and in what order. Linux log timestamps are typically in the format Month Day HH:MM:SS. Steps for timeline reconstruction:
1. Identify the approximate window of interest (when did the anomaly begin?).
2. Use grep with a time-range pattern or journalctl's --since and --until flags to narrow scope.
3. Collect relevant lines from multiple log files into a single working file using redirection and append (>>).
4. Sort all lines by timestamp with sort.
5. Read the sorted output and write your narrative, linking each event to its log source.
A well-written incident narrative includes: who (account name or IP), what (action taken), when (timestamp), where (log file and system), and outcome (success or failure).
Collecting logs only on the host being attacked creates a risk: an attacker with root access can modify or delete local log files. Forwarding logs to a separate, hardened syslog server addresses this problem. This is the foundation of SIEM log pipelines.
rsyslog is the standard log daemon on most Debian/Ubuntu systems. To forward auth.log entries to a remote server, you edit /etc/rsyslog.conf or add a file in /etc/rsyslog.d/ on the sending host. A basic forwarding rule uses the auth facility and sends over UDP or TCP to the receiving server's IP. On the receiving server, rsyslog must be configured to listen on the appropriate port.
Verify log receipt in real time with:
```
tail -f /var/log/syslog
```
on the receiving server while generating login events on the sending VM.
Log integrity means ensuring logs have not been altered after the fact. Forwarding to a remote server immediately upon generation is a practical first layer. In full SIEM pipelines, cryptographic hashing and chain-of-custody controls add further assurance.
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.
Does the school offer financial aid?
No. We don’t offer financial aid because we’re free. No, really: completely free.
Do you offer industry certification?
No. We are not certified yet, so we can’t offer that to students. What we do offer is knowledge and understanding of a trade.
Enroll first in the trade you’re interested in. You get your key, your program opens, and you begin studying.
Enroll free →