teluzia.Cloud Engineer · Day 14
CHAPTER 02 · LINUX ADMINISTRATION AND SHELL SCRIPTING

Week 2 review, recall and recovery

30–90 min including independent practice3 topicsRecall, catch-up, or rest
LET’S MAKE THIS SIMPLE

What you’re learning today

Combine the week’s administration skills into a safe script-based drill. Inspection should precede privilege and scheduled execution, and a private SSH key must never become part of the lab note. id describes active user/group credentials. A process has a PID distinct from a shell job number. Capture $! when starting your own background task and request SIGTERM before considering force. Root access changes permission-test behavior, so normal-user experiments are more informative for everyday file access. Installed package state, service runtime and logs answer different questions. Cron runs with a noninteractive environment, so an explicit script path and diagnostic capture matter. Enabled service state does not prove current health, and a saved schedule does not prove successful task execution.

Think of it this way

This review is a practical inspection bench for identity, processes, service evidence, schedules, ssh and bash: explain, reproduce, break safely, diagnose and verify.

TOPIC 01 / 03Step by step

Identity and process control

id describes active user/group credentials. A process has a PID distinct from a shell job number. Capture $! when starting your own background task and request SIGTERM before considering force. Root access changes permission-test behavior, so normal-user experiments are more informative for everyday file access. Start sleep 60, capture its PID, inspect ps and stop only that captured task; record whoami and id beside the evidence. Exact identity and PID evidence prevents broad destructive actions and connects permissions to the actual process making a request rather than an assumed username. Do not substitute killall or sudo for a failed exact test; those changes can affect unrelated tasks or hide the ordinary authorization boundary being reviewed.

WORKED EXAMPLE
Start sleep 60, capture its PID, inspect ps and stop only that captured task; record whoami and id beside the evidence.
Why this matters

Exact identity and PID evidence prevents broad destructive actions and connects permissions to the actual process making a request rather than an assumed username.

A common trap

Do not substitute killall or sudo for a failed exact test; those changes can affect unrelated tasks or hide the ordinary authorization boundary being reviewed.

Read all topics in this lesson

A complete reference to revisit alongside the guided steps above.

Identity and process control

id describes active user/group credentials. A process has a PID distinct from a shell job number. Capture $! when starting your own background task and request SIGTERM before considering force. Root access changes permission-test behavior, so normal-user experiments are more informative for everyday file access. Start sleep 60, capture its PID, inspect ps and stop only that captured task; record whoami and id beside the evidence. Exact identity and PID evidence prevents broad destructive actions and connects permissions to the actual process making a request rather than an assumed username. Do not substitute killall or sudo for a failed exact test; those changes can affect unrelated tasks or hide the ordinary authorization boundary being reviewed.

WORKED EXAMPLE
Start sleep 60, capture its PID, inspect ps and stop only that captured task; record whoami and id beside the evidence.

Why this matters

Exact identity and PID evidence prevents broad destructive actions and connects permissions to the actual process making a request rather than an assumed username.

A common trap

Do not substitute killall or sudo for a failed exact test; those changes can affect unrelated tasks or hide the ordinary authorization boundary being reviewed.

Service and schedule readiness

Installed package state, service runtime and logs answer different questions. Cron runs with a noninteractive environment, so an explicit script path and diagnostic capture matter. Enabled service state does not prove current health, and a saved schedule does not prove successful task execution. Run a reporting script under env -i HOME="$HOME" PATH=/usr/bin:/bin and compare its output with the ordinary interactive run. Minimal-environment testing catches hidden dependencies before a script repeats unattended, while service/time-scoped logs preserve evidence for a precise diagnosis. Avoid installing a recurring task merely to test syntax; validate the command and review timing first, then install only when the recurring behavior is intended.

WORKED EXAMPLE
Run a reporting script under env -i HOME="$HOME" PATH=/usr/bin:/bin and compare its output with the ordinary interactive run.

Why this matters

Minimal-environment testing catches hidden dependencies before a script repeats unattended, while service/time-scoped logs preserve evidence for a precise diagnosis.

A common trap

Avoid installing a recurring task merely to test syntax; validate the command and review timing first, then install only when the recurring behavior is intended.

Secure automation contracts

Bash needs quoted expansions and explicit exit behavior; SSH needs private-key custody and independent host verification. Both rely on clear trust boundaries rather than blindly suppressing errors. A missing input should yield a diagnostic and nonzero status, while an SSH identity warning requires verification. Run the counting script against a spaced filename and a missing filename; explain why the key fingerprint can be shared but the private key cannot. Input and identity contracts make automation predictable and prevent convenience shortcuts from turning an educational script into credential exposure or unverified remote access. Never fix host-key warnings by disabling verification or fix input errors by always returning zero; both discard the evidence needed to trust the operation.

WORKED EXAMPLE
Run the counting script against a spaced filename and a missing filename; explain why the key fingerprint can be shared but the private key cannot.

Why this matters

Input and identity contracts make automation predictable and prevent convenience shortcuts from turning an educational script into credential exposure or unverified remote access.

A common trap

Never fix host-key warnings by disabling verification or fix input errors by always returning zero; both discard the evidence needed to trust the operation.

KEEP THESE WITH YOU

Today’s takeaways

Inspect before elevation.

Make unattended commands explicit.

Preserve trust and exit contracts.

CLOSE THE LOOP

Ready to complete this day?

Verify your recall or recovery steps, then finish this review day.

Lab steps verifiedReview day: quiz optional