0

I am trying use a command to install / update.

Here are the commands I would like to run:

sudo apt-get update
sudo apt install gnome-session gdm3
sudo apt-get upgrade
sudo apt-get install gnome-terminal

but I have two problems:

  1. I messed up with sudoers

  2. Permission denied (I guess from problem 1)


Sudoers is world writable:

Sudoers is world writable

Permision Denied:

Permision Denied

Nmath
  • 12,664

1 Answers1

1

If you messed up with sudoers (happened to me a lot of time, luckily only in container in docker ;) ), there is a possibility to repair it as root user.

While rebooting, you need to:

  • boot to the recovery mode,
  • mount the root / filesystem with write permissions mount –o rw,remount / and
  • repair the /etc/sudoers file with your preferred command line text editor, e.g. with vim or nano.

How to go to the recovery mode and mount the root / with write permissions is written e.g. here (there is also written how to change your password, if you have forgotten it (happened to me also a few times :D )).

Then just try to rewrite the sudoers file according to your wishes (always, but really always CHECK sudoers file with visudo -c on command line. The BEST would be before closing it!!! (if you are root, then it doesn't matter) It can save you a few minutes...)

Good luck and let us know, if you managed to do it :)

timmotej
  • 111