sudo: Drop root privileges
sudo is a very useful command that will execute a given command as root without opening a root session.
Depending on your configuration you will be able to execute other commands as root -- still using sudo -- without entering the root password.
So let's say you just finished with the sudo command on the machine and have to leave, you don't want to let the other user be able to do sudo commands. (Like sudo passwrd :))
To close the "opened session" use the following:
sudo -k
Written by Guillaume Hain
Related protips
3 Responses
I knew there must be such method but never wondered, thanks! :)
Of course it's always best to just lock your computer when going AFK if you're concerned about your co-workers ;)
@Guillaume: don't you have nice co-workers??? :)
@polysign: Yes I have, but could happen that one of them wants to do a joke... :-D