When I've just run sudo
, and don't want it to remain active for the normal duration of its time-out, how can I cancel that remaining active time-out?
sudo -k
kills it for the current terminal session, but if a process is currently running in that session and so can't run sudo -k
, is there a way to cancel it from another terminal session?
And is there a way to cancel all currently applied sudo
times (for all terminal sessions, and all gksudo running apps, etc?
Although, come to think of it, a running GUI may simply need to be shut down, but I just checked that Alt+F2 keeps gksu active for subsequent invocations.
-K
is practically different to-k
(when -k is used by itseld).., but-k
has a double useage: 1. by itself (invalidates the timestamp)... 2. when used with a command, it prompts for a password, regardless of whether or not a previous sudo timeout has expired..... And by the way: sudo -k works in Alt+F2 to kill the timestamp of a previous sudo/gksu call. – Peter.O Nov 26 '10 at 07:43one-time-only **sudo** is
sudo -k; sudo -k appname.... because although
sudo -k appname` forces the user to enter the password, it leaves a pre-existing timestamp unchanged... (I mention it just as "griss to the mill")... and maybe the simplest way to "kill" all existing timestamps, is to simply avoid the issue entirely and press Ctrl+Alt+L to Lock the screen. :) – Peter.O Nov 26 '10 at 08:14sudo -k
to be run for that session... (thanks to Stefano Palazzo for that: details in his answer) – Peter.O Nov 26 '10 at 11:54