Phase 4. Lesson 5 of 5. About 20 minutes.
Plain entry
Guessing works sometimes. A method works every time, and it is what separates a tech people trust from one they tolerate. CompTIA teaches a six-step model. It is worth memorizing because it is simply what good troubleshooters already do.
Terms
- Theory of probable cause: your best guess at why, which you then test.
- Change one thing at a time: if you change three things and it works, you do not know which fixed it.
Depth: the six steps (CompTIA A+ model)
- Identify the problem. What exactly is wrong? When did it start? What changed? (
/var/log/apt/history.log,last,journalctl --since.) Back up before you touch anything. - Establish a theory of probable cause. Start with the obvious: cable, typo, full disk, recent update.
- Test the theory. If it is wrong, form a new one or escalate.
- Plan the fix and do it. Know how to undo it.
- Verify full system functionality. Did it actually fix it, and did you break something else? Add prevention.
- Document findings, actions, and outcome.
Worked example: “sudo stopped working”
you is not in the sudoers file.
- Identify:
groupsshowsyouwithoutsudo. Someone ranusermod -Gwithout-a. - Theory: user was removed from the sudoA Linux command that runs a single command with administrator (root) privileges, after checking that your account is allowed to do so. Read more → group.
- Test:
getent group sudodoes not list you. Confirmed. - Fix: boot recovery mode (lesson 4.3), root shellThe program that reads the commands you type, runs them, and shows the results; Bash is the default on most Linux systems. Read more →,
mount -o remount,rw /, thenusermod -aG sudo you. Reboot. - Verify:
sudo -vsucceeds;groupsshows sudo. - Document it in
break-fix-log.md, including the lesson:usermod -Greplaces groups,-aGadds.
Use the same template for every break in the lab.
Why it works this way
The method forces one change at a time. If you change three things and it starts working, you do not know which one fixed it, and you may have broken something else. Writing a hypothesis before testing also keeps you honest: a test only means something if you said beforehand what result would prove you wrong.
Self-check
- Name the six steps in order.
- Why back up before step 4?
- What is the difference between
usermod -Gandusermod -aG?
Answers: (1) Identify, theory, test, plan and implement, verify, document. (2) So you can undo a bad fix. (3) -G replaces the group list, -aG appends.
Sources
- CompTIA A+ Core 2 (220-1202) exam objectives, troubleshooting methodology: https://www.comptia.org/certifications/a
usermod: https://man7.org/linux/man-pages/man8/usermod.8.html