UPDATE 2 - if you are using raspberry pi:
Power down and pull the SD card out from your Pi and put it into your computer.
Open the file cmdline.txt
and add init=/bin/sh
to the end or for newer versions: systemd.unit=emergency.target
. (UPDATE 2) . This will cause the machine to boot to single user mode.
Put the SD card back in the Pi and boot.
When the prompt comes up, type su
to log in as root (no password needed).
mv sudoers-newname sudoers
Shut the machine down, then pull the card out again and put the cmdline.txt
file back the way it was by removing the init=/bin/sh
bit or for newer versions: systemd.unit=emergency.target
. (UPDATE 2)
(Text adapted for sudoers deletion from here: http://mapledyne.com/ideas/2015/8/4/reset-lost-admin-password-for-raspberry-pi)
OLD ANSWER:
If you have root password just issue "su" but if you don't have root password, use a live cd, dvd or pendrive to just move the file back again.
For using su just:
#su
Password: Type root password
Via the Live-CD open the terminal and:
$ sudo fdisk -l (to get a list of partitions)
You will see the partition of your linux installation, as something like:
/dev/sda1 * 2048 1936918527 1936916480 923,6G 83 Linux
So if in your case it is /dev/sda1 too, just
sudo -i
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1
mv /mnt/sda1/etc/sudoers-newname /mnt/sda1/etc/sudoers
cd /
umount /mnt/sda1
If you have your linux installed in multiple partitions, just try mounting one by one until you find the correct one or the one that have the etc files.
That is it. Reboot.