[Gambas-user] Create an application with root/sudo previlege
Ian Haywood
ihaywood at ...1979...
Sun Mar 25 08:42:24 CEST 2012
On Sun, Mar 25, 2012 at 4:46 PM, sundar j <sundar_ima at ...251...> wrote:
> I am creating an application which calls bash scripts many time with
> sudo/root privilege. Though i can execute bash script with either kdesu or
> gksu, it asks password many times. Instead it would be nice if any one help
> me on opening an application with sudo/root access. I have searched in
> google and found only this link on the subject
try using "gksudo", this assumes the user is set up to use sudo
[on Ubuntu this is usually the case, not on the others]
Generally it will ask for a password the first time root access is
needed but not thereafter.
The other solution is the traditional UNIX one: to have a small
program which is "su exec", this is particular
mode which means the program is run as whoever owns the file, not the
user running it.
The mode is set using chmod
chmod u+s my-program
The wrinkle this that interpreted programs like Gambas can't do this,
only complied programs can
So you would need to write a small program in C/Pascal etc to do the
su work which the gambas program
calls.
Ian
More information about the User
mailing list