Cancel Remaining Sudo Timeout – How to Guide

sudo

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.

Best Answer

Not sure if you mean to kill a sudo timeout so it doesn't timeout or so it times out immediate, but if you want to remove the remaining timestamp you can use sudo -k

Otherwise,if you're trying to cancel a timeout so sudo doesn't timeout, I don't think that is possible to do in a current session. The only way I know of would be to change the timestamp_timeout in the sudoers file and restart the session.