1

On Ubuntu 14.04 LTS

I would like to force certain terminal commands to run as root - or at least require the user password - to execute.

For instance, poweroff requires sudo while gnome-session-quit --logout (which I have aliased as logout) does not.

How could I require sudo when running logout or any other command of my choosing?

  • Good question, can't find the answer anywhere. – Tim Jun 23 '15 at 21:28
  • 1
    The [question I've closed this against](http://askubuntu.com/q/15853/) should get you there. You might have to switch from bash aliases to functions or scripts, but it'll do what you want. – Oli Jun 23 '15 at 21:28

0 Answers0