I’m using Pop Os 22.04 LTS and I moved the sudoers file to sudoers.bak, with the command sudo /etc/sudoers /etc/sudoers.bak. Then every time I try to run a sudo command it says that the sudoers file doesn’t exist.
I tried to use pkexec to run nano for editing the file and apt-get purge/install sudo for reinstalling sudo, but in both cases when I put my user password it failed with the message:
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/bin/apt-get' as the super user
Authenticating as: (user_name)
Password: (password)
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized
This incident has been reported.
I also tried to use su - but again, when I put my password I get an error saying su: Authentication failure
You’ve accidentally broken the sudo system by renaming the /etc/sudoers file. This makes sudo unusable system-wide, and also breaks tools like pkexec and su, especially in a system like Pop!_OS, where sudo is the default escalation path.
Here’s how to recover, step by step.
1. Why This Happened
The command:
sudo /etc/sudoers /etc/sudoers.bak
did not copy the file — it ran /etc/sudoers as if it were a binary and gave /etc/sudoers.bak as an argument. Since sudoers is not executable, this command likely did nothing meaningful. You probably moved or deleted/etc/sudoers in a different step.
Once /etc/sudoers is missing or invalid, all sudo commands break — you can’t even use pkexec or su normally without root privilege or a working policy agent session.
2. How to Fix It
You’ll need to boot into recovery mode, or use a live USB of Pop!_OS or Ubuntu.
Option A: Recovery Mode (if accessible)
Reboot your machine.
Hold Shift (for BIOS) or Esc (for UEFI) after the firmware splash screen to enter the GRUB menu.
Choose the Advanced options.
Select the Recovery mode kernel (usually has (recovery mode) in the name).
From the recovery menu, choose “Root” — this opens a root shell without needing sudo.