We will have to add a sudoer
rule for you. You can do this by adding a sudo snippet in the /etc/sudoers.d
directory. For example, for allowing your current user to run /usr/sbin/gparted
, issue the following command:
echo $( whoami ) ALL=NOPASSWD: /usr/sbin/gparted | sudo tee /etc/sudoers.d/mysudorule
At this point you can launch sudo -i /usr/sbin/gparted
and it will launch with elevated privileges. Since now you can launch the appplication as root, no questions asked, you can go to the Startup Applications
program and add a new entry where you fill the command with sudo -i /usr/sbin/gparted
. Note that I have not tested this. The -i
tells it to fully log in as root.
All examples here use /usr/sbin/gparted
because it's tool that requires root, and as such was easy to test. Obviously, you'll need to use your own programs full path.
I know there is a discussion that you should never run sudo
for a graphical program, but gksu
is not installed by default, and pkexec
asks a password regardless of the sudoers configuration. My tests indicate that sudo -i
just works fine for graphical applications.