Not require sudo for running specific application as root

Karan Grover woodenrat at
Thu Apr 22 15:21:17 UTC 2010

Hi Dotan

This is a cheeky one, but i hope it may do the job for you.
You can define an alias for the command required to run the application 
in the users home directory profile for that particular application.
#vi .profile
alias <application command>='sudo <application command>

ask the user to log out and log in again.
This may solve the issue



Dotan Cohen wrote:
> A user needs to run a specific application as root. I have finally
> convinced him not to run the whole desktop as root, but now he must
> precede the command to run the application with "sudo -i".
> Is there a way to configure the system not to require the "sudo -i"
> for this particular application? I know that I can remove the need for
> a password for sudo, but that does not help as he still needs to give
> the proper environment with "-i".
> Yes, I am aware that there probably is "a better way" but I am trying
> to get this user into the better habit of not running the desktop as
> root.
> My current idea is to add $HOME/.bin to his path, then mask the
> command with a bash script that simply calls "sudo -i" before calling
> the original command. I would disable sudo passwords for his account.
> Any other ideas?

More information about the ubuntu-users mailing list