The preferred method would be to install sudo on the phone, and to use it to execute scripts/commands with root privileges. I did that, and it works very well.
Why would you want to do this?
The app is designed to run as normal user and if it needs root rights it should use some service or helper binary.
The only thing you might achieve e.g. is to write some config files as root and cannot access them later via normal user…
Giving password in command line is definitely not a good approach as everything would be stored in .bash_history…
but you might do so by echoing the password and pipe it to the command (on purpose not written out explicitly )
I don’t know what exactly the problem is that you’re trying to solve, but I have a hunch that it might be be sufficient to do chown :privileged and chmod g+s on the executable and then run it normally from the app grid. I wouldn’t recommend running apps with root privileges.
To enable flight mode as an action in Situations app, use the following command: sudo /usr/bin/dbus-send --system --dest=com.nokia.mce --print-reply /com/nokia/mce/request com.nokia.mce.request.req_radio_states_change uint32:0 uint32:1
To switch back to normal mode (disable flight mode): sudo /usr/bin/dbus-send --system --dest=com.nokia.mce --print-reply /com/nokia/mce/request com.nokia.mce.request.req_radio_states_change uint32:1 uint32:1
Again, sudo is the only suitable method for this kind of requirement. All other hacks, such as suid-executables, are just hacks. One can use them on a mobile phone, but never ever on a real unix system.
It’s normal behavior. The line you put authorizes user ‘nemo’ to call ‘sudo’ but with ‘nemo’ passwd.
You could put for example:
nemo ALL= (ALL) NOPASSWD: /usr/bin/connmanctl
AFAICT setgid doesn’t work with scripts, you have to do that with the executable itself. And of course you need to have permissions to set that bit. Or the executable could be already installed that way with %attr(2755,root,privileged) in the spec, that’s what I would do.