View Full Version : howto fix corrupted sudoers file?
morlix
02-12-2010, 11:57 AM
Hello Community,
i recently got my N900 and iīm happy with it.
Today i upgraded severall apps using Extras, Extras-Testing and Extras-Devel and no is my sudoers file broken.
It says:
>>> sudoers file: syntax error, line 7 <<<
>>> sudoers file: syntax error, line 67 <<<
sudo: parse error in /etc/sudoers near line 7
How can i fix this?
I have installed rootsh, but sudo gainroot doesnīt work without a valid sudoers file and rootsh /bin/sh says that it is deprecated and is should use root or sudo gainroot instead.
The last apps i have upgraded (i hope i remember the right ones):
wizard-mounter
fmboost
fapn
Is there any other solution beside reflashing the device?
If reflashing is the only solution, do i loose my contacts if i reflash?
I do not have a microSD cad yet to make a backup.
Kind regards,
morlix
Bratag
02-12-2010, 12:03 PM
Hello Community,
i recently got my N900 and iīm happy with it.
Today i upgraded severall apps using Extras, Extras-Testing and Extras-Devel and no is my sudoers file broken.
It says:
>>> sudoers file: syntax error, line 7 <<<
>>> sudoers file: syntax error, line 67 <<<
sudo: parse error in /etc/sudoers near line 7
How can i fix this?
I have installed rootsh, but sudo gainroot doesnīt work without a valid sudoers file and rootsh /bin/sh says that it is deprecated and is should use root or sudo gainroot instead.
The last apps i have upgraded (i hope i remember the right ones):
wizard-mounter
fmboost
fapn
Is there any other solution beside reflashing the device?
If reflashing is the only solution, do i loose my contacts if i reflash?
I do not have a microSD cad yet to make a backup.
Kind regards,
morlix
Well my first thought would be to uninstall the apps with the --purge flag. this hopefully will roll back the changes.
Rob1n
02-12-2010, 12:06 PM
Is there any other solution beside reflashing the device?
You could probably edit it in R&D mode (http://wiki.maemo.org/R&D_mode)
fred123
02-12-2010, 12:06 PM
I have just had this problem, had wizard-mounter installed last night then removed it.
I ran update-sudoers as root
Rob1n
02-12-2010, 12:07 PM
Well my first thought would be to uninstall the apps with the --purge flag. this hopefully will roll back the changes.
Except that if you can't get root, you can't uninstall them. You probably won't even be able to do so via App manager.
morlix
02-12-2010, 12:10 PM
Thanks for the quick replies.
I canīt get root and the app manager says that no catalogue is installed.
@Rob1n: to get into R&D mode i have to flash device and i want to avoid that if possible
Rob1n
02-12-2010, 12:15 PM
Thanks for the quick replies.
I canīt get root and the app manager says that no catalogue is installed.
@Rob1n: to get into R&D mode i have to flash device and i want to avoid that if possible
You shouldn't need to reflash the device - you need to run the flasher app, but I don't think you need to actually provide it with an image to flash. I've not tried it myself, but that's certainly the impression I've got from others.
fred123
02-12-2010, 12:17 PM
I just typed root not "sudo gainroot" and it gave me root in terminal.
Then ran update-sudoers.
This was after a reboot.
Matan
02-12-2010, 12:20 PM
You can enter R&D mode without flashing, but it will not help, as gainroot depends on sudo to gain root access. If you did not prepare in advance (sshd, another boot partition, some suid root binary that can run a shell), you are out of luck.
There are many programs that run as root on the system. If you can find a vulnerability in them that enables you to run arbitrary code, you might be able to fix the problem without a reflash.
morlix
02-12-2010, 12:22 PM
@fred123
i tried this too, but i get errors from sudo like above.
@Rob1n
Thx i will try this!
born2wonder
02-12-2010, 12:30 PM
I have installed rootsh, but sudo gainroot doesnīt work without a valid sudoers file and rootsh /bin/sh says that it is deprecated and is should use root or sudo gainroot instead.
Have you tried "sudo nano /etc/sudoers" as user instead of "sudo gainroot" ?
I doubt it will work but worth a shot. Otherwise, Rob1n's suggestion is your best bet.
I do not have a microSD cad yet to make a backup.
You do not need a microSD card since the backup can be stored on the 32gb flash memory.
Shaq
morlix
02-12-2010, 12:46 PM
@born2wonder
No "sudo nano /etc/sudoers" doesnīt work. I tried with vim, but this shouldnīt make a difference.
You do not need a microSD card since the backup can be stored on the 32gb flash memory.
Shaq
Thatīs right. I had my N900 connected via USB, because of that the backup apps said no microSD card for backup available.
After removing the usb cable the backup is working fine.
I think iīm going to reflash the device, because any other way will take so much time to fix it.
thanks anyone!
asys3
02-12-2010, 02:09 PM
I have the exact same problem here - but I am quite sure I only installed catorize.
Afterwards the sudoers file was corrupted.
What a pity that I haven't installed sshd server before :-(
Please post here if you have success with reflashing.
Than I'll do the same.
asys3
morlix
02-12-2010, 02:30 PM
Yes after reflashing (warm) it works like a charm.
You should make a backup of everything before you flash your n900 because afterwards you can restore the backup and nearly everything will be like before.
Corwin
02-13-2010, 12:47 PM
Same thing here, solved it by sshing to the N900 and also running update-sudoers. That fixed it for me.
I also upgraded wizard-mounter, will report it there:
http://talk.maemo.org/showthread.php?t=44188
Best regards,
Corwin
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.