maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia 770 (https://talk.maemo.org/forumdisplay.php?f=24)
-   -   Run process/program as root from the menu (https://talk.maemo.org/showthread.php?t=10139)

tundrwd 2007-10-01 16:55

Run process/program as root from the menu
 
I'd like to be able to run processes or programs from the standard menu - but do it as root. Processes like - grsync/rsync, backup/restore, etc.

I know I can drop to xterm, sudo, and run the command from the command line that way, I'd simply like something more convenient.

I'm running the latest 2007HE firmware.

Tahitibob 2007-10-01 18:20

Re: Run process/program as root from the menu
 
Hi
You should try out Kerez :
http://david.hautbois.free.fr/joomla...d=44&Itemid=43

David.

TA-t3 2007-10-02 10:19

a
 
Quote:

Originally Posted by tundrwd (Post 78864)
I'd like to be able to run processes or programs from the standard menu - but do it as root. Processes like - grsync/rsync, backup/restore, etc.

I know I can drop to xterm, sudo, and run the command from the command line that way, I'd simply like something more convenient.

I'm running the latest 2007HE firmware.

You should be able to do this if you set the executable to suid root (NB: Won't work for scripts). I haven't tested this on an IT but it's standard Unix/Linux:

In xterm (once):
sudo gainroot
chown root /path/to/executable
chmod u+s /path/to/executable

After this the executable should run as root (unless it's a script).
NB:NB:NB: These kind of tricks lets you open to all kind of security problems, but should be ok unless you let someone else get access to your device (beware of networks).

tundrwd 2007-10-02 12:48

Re: a
 
Quote:

Originally Posted by TA-t3 (Post 79056)
You should be able to do this if you set the executable to suid root (NB: Won't work for scripts). I haven't tested this on an IT but it's standard Unix/Linux:

In xterm (once):
sudo gainroot
chown root /path/to/executable
chmod u+s /path/to/executable

After this the executable should run as root (unless it's a script).
NB:NB:NB: These kind of tricks lets you open to all kind of security problems, but should be ok unless you let someone else get access to your device (beware of networks).

Yeah, that one I knew, and should have said I want to explicitly avoid. It's a big security risk. And being as the point of this device is to access networks, that seems to be a double "don't do this".

fanoush 2007-10-02 12:56

Re: Run process/program as root from the menu
 
safer way is to modifiy /etc/sudoers (i.e. add just your script/command there) and then have your script called from menu to call sudo. See e.g. how it is done in kbdd but replace 'sudo gainroot' for something you added to /etc/sudoers


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

vBulletin® Version 3.8.8