Synology-Forum.nl

Tweaks / Addons A.K.A. The Underground => Algemeen => Topic gestart door: kenoro op 21 april 2019, 00:50:48

Titel: Changed the passwd file and lost root access to the NAS
Bericht door: kenoro op 21 april 2019, 00:50:48
Hi,

I changed by mistake the passwd file,

from "root:/bin/ash" to "root:/sbin/nologin"

I was trying to change the root access of a user, but I didn't pay attention :(

now i dont have any root permissions any more, I can see the file with WinSCP but I can not edited.

Putty does not allow me to change to root with sudo -i and returns /sbin/nologin: command not found

Can I do any thing to repair the mistake?

Thank you
Titel: Re: Changed the passwd file and lost root access to the NAS
Bericht door: Briolet op 21 april 2019, 12:21:58
Engels? Daar bestaat een Engelstalig forum voor.
Titel: Re: Changed the passwd file and lost root access to the NAS
Bericht door: Birdy op 21 april 2019, 13:23:17
De enige mogelijkheid is om DSM opnieuw te installeren:
Modus 2: Synology NAS resetten en besturingssysteem DSM opnieuw installeren (https://www.synology.com/nl-nl/knowledgebase/DSM/tutorial/General_Setup/How_to_reset_my_Synology_NAS#t3)
Titel: Re: Changed the passwd file and lost root access to the NAS
Bericht door: Briolet op 21 april 2019, 17:55:55
In het algemeen vind ik dat als iemand geen moeite wil doen voor het stellen van een fatsoenlijke vraag, hij/zij niet kan verwachten dat anderen moeite doen deze te beantwoorden.

Wat dat betreft is Birdy nog veel te netjes.  ;)
Titel: Re: Changed the passwd file and lost root access to the NAS
Bericht door: DSGebruiker op 21 april 2019, 18:19:18
Trouwens, je kan toch perfect de /etc/passwd edition dmv "sudo" ? Daar komt geen shell aan te pas normaal gezien. Sudo houd eigenlijk geen rekening met deze entry in /etc/passwd, behalve als je een poging doet de shell te launchen (vb sudo -i)

Probeer eens :
 :oops:
sudo vi /etc/passwd

zet je fout terug recht en saven maar.
Titel: Re: Changed the passwd file and lost root access to the NAS
Bericht door: Birdy op 22 april 2019, 12:20:48
sudo vi /etc/passwd werkt idd (getest ;) )