2

I have a quicklauncher in a plasma widget (which is the same as a shortcut) which runs a command which needs administration privilege. I use the quicklauncher frequently and do not want to type root password each time.

Is there a way to give root privilege to the icon or somehow add the password to the command which is run by the icon?

  • I think this is what you are looking for: http://askubuntu.com/questions/147241/execute-sudo-without-password – Jacob Vlijm Mar 12 '14 at 07:55
  • the question seems to be terminal window specific, the icon runs a command without any windows. btw, I'll try to check that threads options. – Minimus Heximus Mar 12 '14 at 08:28

1 Answers1

2

if you would like to run it without a terminal window, and set the password in the command specifically (without editing sudoers), another option is to create a script like:

#!/bin/bash
echo <password> | sudo -S <command>

-and run it from your launcher (quicklauncher).

The command in the launcher would be:

/bin/bash 'path_to_script.sh'

The downside is that you have your password stored in a file on a risky location. To work around the safety issue, you could locate the scrypt on a small truecrypt volume.

(inpsired by this thread)

Jacob Vlijm
  • 83,767
  • still it's terminal window specific, because the icon itself launches a dialog box for the password. But I think it can be disabled by disabling feedback. I wonder if no terminal is opened it will work! – Minimus Heximus Mar 12 '14 at 09:11
  • I am not that familiar with plasma, but a "regular" .desktopfile runs this script without a terminal window. I was thinking, you could work around the safety issue to locate the script on a tiny truecrypt volume on a stick or so. – Jacob Vlijm Mar 12 '14 at 09:16