cancel
Showing results for 
Search instead for 
Did you mean: 
TudorRaduta
Community Manager
Community Manager
  • 56 Views

My biggest sudo mistake (and how to avoid it)

A tiny typo that broke `sudo` for everyone...

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.

The Polish: ALWAYS use the 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.

Time to share:

  1. What's another "safety command" like visudo that has saved you from a big mistake? (e.g., `systemctl --dry-run`)
  2. Tell us about a time a small typo caused a big problem during your RHCSA practice!

Let's hear your stories in the comments!

1 Reply
Chetan_Tiwary_
Community Manager
Community Manager
  • 14 Views

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. 

0 Kudos
Join the discussion
You must log in to join this conversation.