How to change back /etc/sudoers file right to 0440?
Solution 1:
If you have the root password then you can use su to gain root permissions and change the perms on the sudoers file.
$ su -
Password:
#
Another option is to boot into single user mode.
To do this restart your system and at the grub screen press Esc. Select the kernel you want to boot and press e
selct the kernel
line and press e
again. Append S
to the end of the line and press Enter
then press b
. This will take you to single user mode and allow you to change the perms on /etc/sudoers.
Note that Ubuntu systems may have a (recovery mode) option which boots to single user mode already configured in grub.
Solution 2:
iain's suggestion is better, but if that isnt an option for some reason, you can add init=/bin/bash to the kernel line in grub at boot time which'll normally drop you to a root shell.