Ubuntu - Can I resolve this issue "sudo: /etc/sudoers.d is world writable" by updating my ubuntu from 16.04 to 18.04?

0

I am having a problem with my sudo command in my ubuntu, that is because I think I had run the permission command on my computer directory. I found that on the internet everybody is saying that in this situation we have to reinstall the ubuntu. What if I update my ubuntu from 16.04 to 18.04, would it be ok or would it remove my issue?

Thank you.

shashi verma

Posted 2018-11-29T06:25:21.160

Reputation: 101

1Take a try, then share the consequence. – Ipor Sircer – 2018-11-29T06:29:47.087

Reinstalling can be any version; you're basically starting over with a clean slate that doesn't reflect things you might have messed up. – fixer1234 – 2018-11-29T06:56:50.677

@fixer1234 so should I reinstall or update? – shashi verma – 2018-11-29T07:10:26.520

When people say "update" one major release to another major release, it's an upgrade or reinstallation. If you're fluent in Linux, you can upgrade, but it isn't always a clean, simple process because of how much changes between major releases. I'm also not sure if upgrading replaces all of the configuration files, especially user files like the .d files. Reinstalling is safer and cleaner because you're starting with a fresh setup, with everything set to the distro defaults. – fixer1234 – 2018-11-29T07:24:49.810

Answers

1

That's why what Ubuntu is doing with root account is not very smart - once sudo breaks you are out of options.

But - you can try to boot in single user mode. If you are lucky it will let you in without password. Adding 1 or single to kernel command line should do the trick. If this does not work try passing init=/bin/bash (or whatever shell you have installed) to kernel command line. Once in a shell fix permissions on /etc/sudoers.d (my system has 750 on it) and you should be good to go. Reboot and enjoy.

Once you are back to your normal login, do sudo su - and set root password! Save it somewhere and next time just login or su to root and fix whatever is needed.

Tomek

Posted 2018-11-29T06:25:21.160

Reputation: 795

0

Upgrade to 18.04 probably won't help.

Upgrade is performed by changing package repositories to newer ones and installing new set of packages. Some packages will remain, though, and may still have broken permissions.

The only safe method of restoring this system is wiping it clean and installing from scratch. Unless you have backups, of course, but if you had, you wouldn't be asking this question.

The lesson to learn here is that you should be making regular backups.

gronostaj

Posted 2018-11-29T06:25:21.160

Reputation: 33 047