Last Updated: March 03, 2016
·
2.31K
· zedtux

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

3 Responses
Add your response

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 ;)

over 1 year ago ·

@Guillaume: don't you have nice co-workers??? :)

over 1 year ago ·

@polysign: Yes I have, but could happen that one of them wants to do a joke... :-D

over 1 year ago ·