maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   sudo parse error in /etc/sudoers,,,, (https://talk.maemo.org/showthread.php?t=65268)

facs 2010-11-08 09:29

sudo parse error in /etc/sudoers,,,,
 
I've edited file /etc/sudoers on N900 and now I receive this error:
sudo parse error in /etc/sudoers,,,,
I 've not root access, no usb or wifi access. How can I do to solve this problems?

Thanks a lot.

jedi 2010-11-08 09:32

Re: sudo parse error in /etc/sudoers,,,,
 
Quote:

Originally Posted by facs (Post 866713)
I've edited file /etc/sudoers on N900 and now I receive this error:
sudo parse error in /etc/sudoers,,,,
I 've not root access, no usb or wifi access. How can I do to solve this problems?

Thanks a lot.

How did you edit it without root access?


it might help if you paste the contents of the file here...

facs 2010-11-08 09:34

Re: sudo parse error in /etc/sudoers,,,,
 
I've edited the file with root access (sudo gainroot), after I've closed root session .....

Rob1n 2010-11-08 09:40

Re: sudo parse error in /etc/sudoers,,,,
 
Quote:

Originally Posted by jedi (Post 866717)
How did you edit it without root access?


it might help if you paste the contents of the file here...

Presumably he did have root access, but gaining it requires a working sudoers file (as does installing packages, etc) so once you've messed it up then you're stuffed.

Quote:

Originally Posted by facs (Post 866713)
I've edited file /etc/sudoers on N900 and now I receive this error:
sudo parse error in /etc/sudoers,,,,
I 've not root access, no usb or wifi access. How can I do to solve this problems?

R&D mode is a possibility, otherwise a reflash will be required.

Incidentally, you shouldn't edit /etc/sudoers directly - you should create a new file (or edit an existing one) in /etc/sudoers.d and the run update-sudoers. That includes a check for correctness, so should prevent this from happening. If you do need to edit the file directly, use visudo which will, again, check the file before saving it.

karimko 2010-11-08 09:42

Re: sudo parse error in /etc/sudoers,,,,
 
+1 to R&D mode, tried it myself when i was stuck in the OP's situation.

facs 2010-11-08 09:45

Re: sudo parse error in /etc/sudoers,,,,
 
Could you explain to me what command I must launch?
flasher-3.5 --enable-rd-mode
and after?
Thanks a lot.

karimko 2010-11-08 09:59

Re: sudo parse error in /etc/sudoers,,,,
 
after that:
1. Boot normally
2. You'll be able to have root access
3. Revert your sudoers file
4. Restart and disable RD mode.

:)

Rob1n 2010-11-08 09:59

Re: sudo parse error in /etc/sudoers,,,,
 
Quote:

Originally Posted by facs (Post 866730)
Could you explain to me what command I must launch?
flasher-3.5 --enable-rd-mode
and after?
Thanks a lot.

That should be it. You'll need to set the N900 into flashing mode first though.

facs 2010-11-08 10:04

Re: sudo parse error in /etc/sudoers,,,,
 
thanks a lot !!!!!
I try and I send to you the result.

jd4200 2010-11-08 10:07

Re: sudo parse error in /etc/sudoers,,,,
 
What program did you use to edit the file?

You should only use 'vi' to edit the file (using the command 'visudo'), as other editors can give syntax errors.

facs 2010-11-08 10:09

Re: sudo parse error in /etc/sudoers,,,,
 
I've used leafpad .... grrrrr
In futur I'll use visudo.

Thanks.

facs 2010-11-08 10:31

Re: sudo parse error in /etc/sudoers,,,,
 
Quote:

Originally Posted by karimko (Post 866749)
after that:
1. Boot normally
2. You'll be able to have root access
3. Revert your sudoers file
4. Restart and disable RD mode.

:)

Is it correct:
1. shutdown device
2. Press and hold down the 'u' key
3. Connect a USB cable between the Maemo device and host PC while holding down the 'u' key
4. When the USB cable is connected, it powers the Maemo device and sets it to flashing mode
5. When the USB icon appears in the upper right-hand corner, the Maemo device is in flashing mode
6. Release the 'u' key
7. flasher-3.5 --enable-rd-mode or flasher-3.5 --enable-rd-mode -R
8. Boot normally
9. You'll be able to have root access
10. Revert your sudoers file
11. shutdown device
12. Press and hold down the 'u' key
13. Connect a USB cable between the Maemo device and host PC while holding down the 'u' key
14. When the USB cable is connected, it powers the Maemo device and sets it to flashing mode
15. When the USB icon appears in the upper right-hand corner, the Maemo device is in flashing mode
16. Release the 'u' key
17. flasher-3.5 --disable-rd-mode or flasher-3.5 --disable-rd-mode -R

I've a doubt, when I use flasher to set or unset R&D mode I must to use -R option? Are correct these instructions?

Thanks a lot

AlMehdi 2010-11-08 10:45

Re: sudo parse error in /etc/sudoers,,,,
 
Quote:

Originally Posted by facs (Post 866761)
I've used leafpad .... grrrrr
In futur I'll use visudo.

Thanks.

leafpad should give you that problem.. have used it tonnes of times. Also by editing sudoers...

AlMehdi 2010-11-08 10:47

Re: sudo parse error in /etc/sudoers,,,,
 
Quote:

Originally Posted by facs (Post 866787)
Is it correct:
1. shutdown device
2. Press and hold down the 'u' key
3. Connect a USB cable between the Maemo device and host PC while holding down the 'u' key
4. When the USB cable is connected, it powers the Maemo device and sets it to flashing mode
5. When the USB icon appears in the upper right-hand corner, the Maemo device is in flashing mode
6. Release the 'u' key
7. flasher-3.5 --enable-rd-mode or flasher-3.5 --enable-rd-mode -R
8. Boot normally
9. You'll be able to have root access
10. Revert your sudoers file
11. shutdown device
12. Press and hold down the 'u' key
13. Connect a USB cable between the Maemo device and host PC while holding down the 'u' key
14. When the USB cable is connected, it powers the Maemo device and sets it to flashing mode
15. When the USB icon appears in the upper right-hand corner, the Maemo device is in flashing mode
16. Release the 'u' key
17. flasher-3.5 --disable-rd-mode or flasher-3.5 --disable-rd-mode -R

I've a doubt, when I use flasher to set or unset R&D mode I must to use -R option? Are correct these instructions?

Thanks a lot

the -R will only reboot your n900 so it is not necessary.

facs 2010-11-08 10:50

Re: sudo parse error in /etc/sudoers,,,,
 
Quote:

Originally Posted by AlMehdi (Post 866807)
the -R will only reboot your n900 so it is not necessary.

after the commands:
flasher-3.5 --enable-rd-mode
flasher-3.5 --disable-rd-mode
the N900 boot automatically?
thanks a lot.

Rob1n 2010-11-08 12:04

Re: sudo parse error in /etc/sudoers,,,,
 
Quote:

Originally Posted by AlMehdi (Post 866805)
leafpad should give you that problem.. have used it tonnes of times. Also by editing sudoers...

The issue is that leafpad doesn't make any checks on whether the data is correct. visudo (either directly or via update-sudoers) will do that, preventing you from writing an invalid sudoers file and messing up your system.

karimko 2010-11-08 12:09

Re: sudo parse error in /etc/sudoers,,,,
 
@facs, that's about it... hope it works out! :)

As Rob1n said visudo is not required if you know what you are doing. Visudo to be safe ;)

facs 2010-11-08 12:13

Re: sudo parse error in /etc/sudoers,,,,
 
I've launched the command:
flasher-3.5 --enable-rd-mode
I've opened a terminal but I haven't the root access...
Could you help me?
Thanks.

facs 2010-11-08 12:40

Re: sudo parse error in /etc/sudoers,,,,
 
I've solved using command rootsh /bin/sh from terminal.

THANKS TO ALL FOR YOUR SUPPORT !!!!!!!!!!!
YOU ARE VERY COMPETENT !!!

Thanks a lot .


All times are GMT. The time now is 19:00.

vBulletin® Version 3.8.8