This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I thought I should share this noobish thing I did yesterday, as a warning to others.
TL;DR: as soon as /etc/sudoers is gone, you can't sudo.
So, sudo package was upgraded, and as a result, a new config file (/etc/sudoers
) had to be installed, but since I have modified mine, pacman
saved the new version as /etc/sudoers.pacnew
, and told me about it.
This is where pacman-specific part ends, the rest can happen on any distro, so bear with me. Having compared the two files with Meld, I have decided to copy my only change (uncommented wheel group) to the new file, then rename the old file to sudoers.old
and then rename sudoers.pacnew
to sudoers
.
I naively assumed that sudo would let me do this, if I just stick to the same terminal session.. but no. The moment /etc/sudoers is gone, you can't do jack.
Well, I'll just Ctrl-Alt-F3 into a TTY, log in as root and correct the situation.. wait, I forgot my root password :) Anyway, my storage is not encrypted or anything, so I booted from the first Linux live USB I could find (Mint LMDE, not that it matters), mounted the partition and renamed /etc/sudoers.pacnew to /etc/sudoers.
So don't do this. Don't let /etc/sudoers be gone, even if just temporary, or you'll lose sudo until you fix it.
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/linux/comme...