If you, like I also did, locked yourself out like in this thread:
https://forum.synology.com/enu/viewtopic.php?f=90&p=424906
I got this error:
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
———————————-
I do not support and can not be held responsible for any damage this would do to your device. I only state that it worked for me.
———————————-
SOLUTION
Now I explain what worked for me.
Install Config FIle Editor package in your DSM-package center. It can be found here.
Now you can use Config File Editor to edit your versionnumber and do a downgrade.
First add this line to the config file editor
/etc.defaults/VERSION,version
Close down the Config File Editor and open it again. Choose version in the drop down.
Change buildnumber to eg 7100.
Now you can do a manual downgrade to beta 1 – this gives you your root access back (find the update icon in control panel and do a manual installation af the DSM 6.0 beta 1)
Find your DSM 6.0 Beta 1 here:
http://usdl.synology.com/download/DSM/beta/6.0/7135/
It bricked my Synology. Now I was not able to access my DSM.
But I still/now could login with my root login and pass through SSH.
So login to your NAS with your normal root login and password. (I use PuTTY as explained here – use ssh and type the local ip to your NAS).
Change sudoers chmod to 0440 in the etc-folder
cd etc
chmod 0440 sudoers
Thereafter you are able to upgrade from command line with this command, that I found here.
synoupgrade Copyright (c) 2003-2012 Synology Inc. All rights reserved. --auto --check --download --start --parse --patch ABSOULATE_UPGRADE_FILE_PATH
I used synoupgrade –auto (that worked, 10-15 min. later it was updated and accessible again)
It did display some errors, but ended up with
Then it restarted and voila – it works.
Hope it workes for you to.
4 kommentarer til “chmod /etc/sudoers to 0640 and locked myself out of DSM 6.0 – SOLVED/SOLOUTION!”
[…] chmod /etc/sudoers to 06… […]
Since this post synology have removed all other builds of 6.0 (release and beta).
So my question is, is it possible to do the same with downgrading to 5.0, then back up to 6.0?
majorversion=”5″
minorversion=”2″
productversion=”5.2″
***
buildnumber=”5644″
***
Hi Egil. See this forum-tread for an easy way to solve this problem. Find the post from CoolRaoul
https://forum.synology.com/enu/viewtopic.php?f=90&t=116116&p=427618&hilit=%2FETC%2FSUDOERS#p427618
Found a simple and easy solution
do this:
log in to DSM Web interface as admin
Control Panel -> “Task scheduler”
Add a “user script”:
Image
make it disabled:
Image
insert command which will reset the correct modes (chmod ug=r,o= /etc/sudoers)
Image
run it:
Image
Should be fixed now
SOURCE: https://forum.synology.com/enu/viewtopic.php?t=116116
Thx for posting this.