Quantcast
Channel: How to modify an invalid '/etc/sudoers' file? - Ask Ubuntu
Browsing all 19 articles
Browse latest View live

Answer by Fatih Baltacı for How to modify an invalid '/etc/sudoers' file?

You can bind the /etc volume into docker like that:docker run -it --rm -v /etc:/etc_host ubuntu bashYou gained root access. Then you can change the permissions of /etc/sudoers to 777:chmod 777...

View Article



Answer by NotTheDr01ds for How to modify an invalid '/etc/sudoers' file?

For WSL users, accessing a bad sudoers is much more straightforward:wsl.exe -u root visudoIf you cannot recover the file manually this way, you can reset it to the default installed version (adapted...

View Article

Answer by jnlickey for How to modify an invalid '/etc/sudoers' file?

If you have access to reboot the server, you can reboot it and catch it at the grub prompt for Ubuntu. Press 'e' to edit the grub boot config.Find the line that starts with linux and is indented, then...

View Article

Answer by Ali Tou for How to modify an invalid '/etc/sudoers' file?

When this happens to a non-GUI system (your production server, maybe) the pkexec fails with this error message:polkit-agent-helper-1: error response to PolicyKit daemon:...

View Article

Answer by Jack Hamilton for How to modify an invalid '/etc/sudoers' file?

Adding this for the new wave of WSL-based Linux VMs. When I locked myself out of my debian-based WSL2 VM (Pengwin) which didn't have pkexec and the root password was not set, here's what I found fixed...

View Article


Answer by rien333 for How to modify an invalid '/etc/sudoers' file?

There is a way simpler solution. Without rebooting, recovery mode, or pkgexec (pkgexec didn't work and have no idea why or how I should use it), simply do:su root # switch to root user, without using...

View Article

Answer by biocyberman for How to modify an invalid '/etc/sudoers' file?

Good practice: a backup terminal window and run sudo su there. On another termianl run visudo or sudo vim /etc/sudoers. If anything goes wrong, go back to terminal one and fix the file. You may ask,...

View Article

Answer by Juha Untinen for How to modify an invalid '/etc/sudoers' file?

In Ubuntu 16.04 running on a VirtualBox (shouldn't make a difference), the above methods didn't work for me (invalid row in the end of the file). What did work was:Restart the VirtualBoxLet it boot...

View Article


Answer by Kresimir Pendic for How to modify an invalid '/etc/sudoers' file?

if anyone else like me didn't have pkexec installed, or was not able to run vi, visudo, nano or any other editor to change sudoers file you can be sure with this process.. I was saved with...

View Article


Answer by Bhavesh Gabani for How to modify an invalid '/etc/sudoers' file?

pkexec visudothen revert your mistakes

View Article

Answer by magisterludi for How to modify an invalid '/etc/sudoers' file?

You can also login as root on a tty console with Ctrl+Fn (Fn from 1 to 6) and run visudo.

View Article

Answer by Andrej Burcev for How to modify an invalid '/etc/sudoers' file?

Type in:pkexec visudoThen change last line#includedir /etc/sudoersTo:#includedir /etc/sudoers.dIt should solve your problem.

View Article

Answer by Markus Ressel for How to modify an invalid '/etc/sudoers' file?

You can edit your boot entry while in grub as well.Simply reboot your pc, and wait for grub to show. Then press "e" on the "Ubuntu" entry to edit it.Look for a line with "linux = " or "kernel = " and...

View Article


Answer by streak for How to modify an invalid '/etc/sudoers' file?

If you messed up your sudoers file, you'll need to:Reboot into recovery mode (hit escape during boot, choose the recovery mode option on the grub screen)Choose the 'Enable networking' option (if you...

View Article

Answer by Thusitha Nuwan for How to modify an invalid '/etc/sudoers' file?

There is nothing wrong #include sudoer.dremoving #include sudoer.d won't make any difference. But please make sure you don't have any syntax errors.I had same issue but and spent hours to fix and just...

View Article


Answer by kosaidpo for How to modify an invalid '/etc/sudoers' file?

run recovery mode then type this chown -R root:root /etc/sudoers.dchmod u=rwx,g=rx,o=rx /etc/sudoers.d/chmod u=r,g=r,o= /etc/sudoers.d/*only the group and user root should have read privelege

View Article

Answer by Caesium for How to modify an invalid '/etc/sudoers' file?

Always use visudo to edit your sudoers file, never edit it directly yourself. It will prevent you saving it to disk unless it validates.

View Article


Answer by Eliah Kagan for How to modify an invalid '/etc/sudoers' file?

On a modern Ubuntu system (and many other GNU/Linux distributions), fixing a corrupted sudoers file is actually quite easy, and doesn't require rebooting, using a live CD, or physical access to the...

View Article

How to modify an invalid '/etc/sudoers' file?

How do I edit an invalid sudoers file? It throws the below error and it's not allowing me to edit again to fix it.Here is what happens:$ sudo visudo>>> /etc/sudoers: syntax error near line 28...

View Article
Browsing all 19 articles
Browse latest View live




Latest Images