1

When I'm done with making Ubuntu remember my password and do not ask for it before risky actions...

Is there a way to get safe pop up confirmation window (without password input, just OK or cancel)?

So I will know when a pesky program runs a risky action that I don't want to proceed?

Or it is not developed since the program could just simulate a click on OK anyway?

kiri
  • 28,986
Esamo
  • 1,542

2 Answers2

1

No, there is no way to do this. If you enable sudo without a password (How to run sudo command with no password?), then any process you run can execute sudo and run code as root without any confirmation.

bain
  • 12,200
-1

Let's write a small program for that:

Create /usr/local/bin/sudo:

#!/bin/sh
read -p "You sure you want to run sudo? " ans
case "$ans" in
y|Y|[yY][eE][sS]) ;;
*) exit ;;
esac
exec /bin/sudo "$@"

You could also create it in a temporary directory, add that directory to path before running that "pesky program". It's not 100% fullproff, but should handle most common cases.

KamilCuk
  • 109