Skip to content
Ameen Abozaid
JNR-048

Linux basics

  • 7 Lessons
  • 3 h practice (estimate)
On this page 8 topics

Overview

Topics

  • Processes
  • permissions
  • SSH
  • ports
  • logs
  • service management

Learn first

3 h of practice (estimate)

Learning outcomes

  1. Inspect processes, memory, and disk (ps, top, free, df), and stop a process.
  2. Read and change file permissions and ownership.
  3. Connect to a server over SSH with key-based authentication.
  4. Find which process listens on a port (ss, lsof).
  5. Read service logs with journalctl and tail -f, and manage a service with systemctl.

Lessons

  1. 01Linux for backend engineers
  2. 02Processes and resources
  3. 03Users, permissions, ownership
  4. 04SSH and keys
  5. 05Ports and networking tools
  6. 06Logs and services
  7. 07Demo: running Shop as a systemd service

Lab and exercises

Lab

JNR-048-LAB1 · Run Shop on Linux

Outcomes: 1–5 · Time: ~3 h On a Linux VM or WSL, run the Shop JAR as a systemd service under a dedicated user, read its logs, and find its port. Acceptance: service restarts automatically after a kill.

Exercises (assessment: timed troubleshooting tasks on a Linux box)

IDOutcomeTask
JNR-048-EX011Find the PID and memory use of a Java process, then stop it gracefully.
JNR-048-EX021Report free memory and the three largest directories under /var.
JNR-048-EX032Given -rwxr-xr-- alice dev script.sh, state who can do what, then make it private to alice.
JNR-048-EX043Create an ed25519 key pair, install the public key on a VM, and log in without a password.
JNR-048-EX054Start two apps on port 8080; find which process holds it.
JNR-048-EX065Show the last 50 log lines of a service from the past 10 minutes and follow new ones.
JNR-048-EX075Make a service start at boot and restart after failure.
Show solutions
  • EX01 ps aux | grep java (or pgrep -a java); kill <pid>; kill -9 only if it ignores SIGTERM.
  • EX02 free -h; du -sh /var/* | sort -h | tail -3.
  • EX03 Owner reads, writes, executes; group dev reads and executes; others only read. chmod 700 script.sh.
  • EX04 ssh-keygen -t ed25519, ssh-copy-id user@host, ssh user@host.
  • EX05 ss -tlnp | grep 8080 or lsof -i :8080; stop one app or change its port.
  • EX06 journalctl -u shop --since "10 min ago" -n 50 then journalctl -u shop -f.
  • EX07 sudo systemctl enable shop and Restart=on-failure in the unit file (then daemon-reload).
  • Outcome 2 (permissions) is also covered by quiz Q04–Q05 and the lab (non-root service user).

Quiz

Outcomes: O1 processes and resources · O2 permissions · O3 SSH · O4 ports · O5 logs and services.

A self-check for you: nothing is graded, saved or sent anywhere. Choose an answer, then check it. You can try again as often as you like.

  1. 1Which command shows free disk space?O1
  2. 2kill 4242 sends:O1
  3. 3Which shows live CPU and memory use per process?O1
  4. 4chmod 640 app.env gives others:O2
  5. 5Best practice for a service account:O2
  6. 6Which file goes on the server for key login?O3
  7. 7Which command creates a key pair?O3
  8. 8Find the process on port 8080:O4
  9. 9Follow a systemd service's logs:O5
  10. 10Which unit-file setting restarts a service after a crash?O5

Practical part

Seven exercises JNR-048-EX01 to EX07 plus the lab; the assessment is a set of timed troubleshooting tasks on a Linux box. Pass: quiz 8/10, at least five exercises correct, and the service restarting after a kill.

Common mistakes

chmod 777; running services as root; password SSH logins.

Assessment

Timed troubleshooting tasks on a Linux box.

Career relevance

Containers and production servers are Linux.

Type to search levels, phases, modules and lessons.