0

I have a rather annoying problem on my NAS Synology DS416.

Following a bad manipulation I find myself with the /etc/sudoers file belonging not to root but to another user. And, normal thing, I can't do "sudo" anymore.

Logged in as this user, I can neither modify the ownership of this file nor delete it.

And to fix it, otherwise it would be too easy, my root password is not accepted (or so I don't remember it anymore).

I do not know what to do. I would like to avoid completely resetting my NAS because there are lot of stuff installed (cloud and others) but...

meuh
  • 51,383
  • 1
    Log a call with Synology. But expect the most likely outcome to be that you will need to reset the device – Chris Davies Jul 31 '23 at 08:50
  • You might find a powercycle fixes the problem – Chris Davies Jul 31 '23 at 09:41
  • If you have another Linux system (or OS that can handle ext3 filesystems) you could remove the synology disc and mount it on the Linux machine to edit the files. You might need to use a cheap usb-to-sata adaptor if there are no spare slots on your Linux machine. – meuh Jul 31 '23 at 12:12
  • Did you try the su command to become root with root's passwd? Login as root might be disabled. – meuh Jul 31 '23 at 12:26
  • As specified, I can't do sudo command and root's passwd is not accepted. I use Ubuntu on my PC and I have a cheap usb-to-sata, and I tried it. But without success, disk not recognized. As read on Synology's documentation, as the disk with NAS system is in RAID1 I need to connect the 2 disks in the same time...but I have not a second cheap usb-to-sata (it arrives tomorrow). – Philippe Jul 31 '23 at 14:27

1 Answers1

0

The reset button on synology can do a mode 1 reset (hold 4 seconds) in regards to clearing the root/admin password so you can log in, but will not delete the data on your volume.

https://kb.synology.com/en-sg/DSM/tutorial/How_do_I_log_in_if_I_forgot_the_admin_password

https://kb.synology.com/en-id/DSM/tutorial/How_to_reset_my_Synology_NAS_7

you should also become a member at https://community.synology.com and https://www.synoforum.com/ and ask these sort of synology specific questions there. Last I remember synology screwed up their official forums so the latter unofficial one might be better.

Once you have the root password, and can log in via web browser to the synology and go through that initial setup; then in DSM enable their SSH login so you can log in that way to the synology and unmanipulate whatever you are doing. Given it is ssh, you should be able to edit /etc/ssh/sshd_config there and PermitRootLogin yes followed by a service sshd restart and then login over ssh as root to do what you need.

and also verify from synology knowledge center as much as you can before doing a reset.

your existing data will remain unharmed, as long as you don't explicitly go looking to delete a volume or storage pool. The mode2 reset where you will reinstall DSM that will lose your existing configs, and will likely fix your problem but then you'll have to reinstall the extra apps and set stuff up again.

https://www.synoforum.com/threads/restore-reset-without-losing-your-hard-drive-stuff.2724/

ron
  • 6,575