Active Topics

 



Notices


Reply
Thread Tools
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#11
I forgot a step. Run update-sudoers (as root) after creating the .sudoers file.
 

The Following User Says Thank You to Matan For This Useful Post:
Bec's Avatar
Posts: 876 | Thanked: 396 times | Joined on Dec 2009
#12
ok, now this looks interesting:

>>>sudoers file: syntax error, line 2 <<<
>>>sudoers file: syntax error, line 3 <<<
>>>sudoers file: syntax error, line 4 <<<
/etc/sudoers.d/01sudo changes break sudoers
I have no idea what "01sudo" is and I have undone any changes I made to it:
Defaults env_check+="HOME DISPLAY"
Defaults env_keep+="HOME DISPLAY"
Defaults env_reset
user ALL = NOPASSWD: /usr/sbin/gainroot
user ALL = NOPASSWD: /usr/sbin/mmc-mount /dev/mmcblk0 /media/mmc1
user ALL = NOPASSWD: /usr/sbin/mmc-mount /dev/mmcblk0p1 /media/mmc1
user ALL = NOPASSWD: /bin/umount /media/mmc1,/bin/umount -l /media/mmc1
user ALL = NOPASSWD: /usr/sbin/osso-usb-mass-storage-enable.sh, /usr/sbin/osso-usb-mass-storage-disable.sh
user ALL = NOPASSWD: /sbin/mkdosfs /dev/mmcblk0*, /usr/sbin/mmc-rename /dev/mmcblk0*
user ALL = NOPASSWD: /etc/init.d/af-base-apps stop , /etc/osso-af-init/gconf-daemon.sh stop
user ALL = NOPASSWD: /etc/init.d/af-base-apps start , /etc/osso-af-init/gconf-daemon.sh start
user ALL = NOPASSWD: /etc/init.d/osso-systemui restart
user ALL = NOPASSWD: /usr/sbin/gconf-clean.sh
user ALL = NOPASSWD: /usr/sbin/chroot /mnt/initfs /usr/bin/retutime *
user ALL = NOPASSWD: /sbin/insmod /mnt/initfs/lib/modules/current/g_file_storage.ko stall=0 file=/dev/mmcblk0
user ALL = NOPASSWD: /sbin/insmod /mnt/initfs/lib/modules/current/g_ether.ko
user ALL = NOPASSWD: /sbin/rmmod g_file_storage
user ALL = NOPASSWD: /sbin/rmmod g_ether
user ALL = NOPASSWD: /usr/sbin/osso-backup-restore-locale
user ALL = (install) NOPASSWD: /usr/bin/app-installer-tool
I removed that file to update and then put it back.
Thanks
__________________

Last edited by Bec; 2010-01-17 at 21:24.
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#13
Editing the sudoers file is very difficult to use anything but VI. (I don't know what you use)

The actual recommended way is using "visudo".. I don't know if the N900 has that or not.

Essentially even wrong end of line characters can cause sudo to stop working.

Just some thoughts... in vi if you use ":set list" you can see the end of line characters... ^M == bad.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following 2 Users Say Thank You to fatalsaint For This Useful Post:
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#14
Just don't reboot, Bec, as you might need to reflash your system if you do. Copy a working 01sudo file (for example, from here: http://my.arava.co.il/~matan/770/n900/01sudo ) and run update-sudoers.
 

The Following User Says Thank You to Matan For This Useful Post:
YoDude's Avatar
Posts: 2,869 | Thanked: 1,784 times | Joined on Feb 2007 @ Po' Bo'. PA
#15
Originally Posted by Matan View Post
Add the application to sudoers by creating a file called
/etc/sudoers.d/emelfm2.sudoers containing:
user ALL = NOPASSWD: /usr/bin/emelfm2
Then use Exec = /usr/bin/sudo /usr/bin/emelfm2
or Exec = osso-xterm "sudo emelfm2"
Now that^ can FUBAR your device if you don't know what you are doing.

Originally Posted by qwerty12 View Post
...
For future reference: Use visudo instead of editing sudoers directly. visudo tells you if a line will **** up the entire sudo system when exiting the editor.
The simple addition of an extra space in a line while editing with a plain ol' text editor will screw things up...
__________________

SLN member # 009
 

The Following User Says Thank You to YoDude For This Useful Post:
Bec's Avatar
Posts: 876 | Thanked: 396 times | Joined on Dec 2009
#16
Originally Posted by Matan View Post
Just don't reboot, Bec, as you might need to reflash your system if you do. Copy a working 01sudo file (for example, from here: http://my.arava.co.il/~matan/770/n900/01sudo ) and run update-sudoers.
Now for the best part...
sudo gainroot asks for a password...

For the first time I use it, no matter how many times I've tried to set one (always the same) it didn't seem to work...

Problem is that the usual password doesn't work...
__________________
 
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#17
It asks for user's password, not root password. Did you install openssh server? If so, ssh directly to root.
 

The Following User Says Thank You to Matan For This Useful Post:
Bec's Avatar
Posts: 876 | Thanked: 396 times | Joined on Dec 2009
#18
I've ssh-ited it... surprisingly it stopped asking for a password... awkward
__________________
 
Bec's Avatar
Posts: 876 | Thanked: 396 times | Joined on Dec 2009
#19
Originally Posted by YoDude View Post
The simple addition of an extra space in a line while editing with a plain ol' text editor will screw things up...
As I do realize how close my ignorance brought me to a re-flash I'd apreaciate some details about visudo.

Thanks
__________________
 
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#20
visudo is an editor that checks the file has the corrext syntax for a sudoers file before overwriting the original.
 

The Following User Says Thank You to Matan For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 10:54.