Hey everyone,
Time for our weekly "problem & a polish" where we share a mistake that taught us something valuable. This week's story is a scary one I think many of us have experienced while learning.
The Problem: I needed to give a new user permission to restart a service. I opened /etc/sudoers
directly with a text editor, added my line, and saved it. A minute later, I tried to run a `sudo` command and got an error. It turned out **`sudo` was now broken for everyone** because of a tiny syntax mistake I had made.
It was a heart-stopping moment and a painful reminder of a critical best practice.
visudo
command to edit the sudoers file. It's not just an editor; it's a safety net. It runs a syntax check before saving, preventing you from ever saving a broken file that could lock you (and everyone else) out.
visudo
that has saved you from a big mistake? (e.g., `systemctl --dry-run`)Let's hear your stories in the comments!
Two things immediately come to my mind that were a saviour during my RHCSA preparation :
1. mount -a after editing fstab and before rebooting my server - saved me big time!!!
2. One typo - in #touch /.autorelable instead of #touch /.autorelabel almost cost me my RHCSA exam - that was a lucky save but it did cost a lot of time to catch it during the exam.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.