force sudo to forget password immediately after exit everytime

1

0

If I execute sudo su, I am asked for my password ( [sudo] password for ... )

After do some stuff, I can leave this root mode with exit.

If I execute again sudo su, I will not be asked for a password again. (Only if a few minutes have passed)

I can immediately let it forget the password with sudo -k or sudo -K but how can I disable it completely for all users or better: How can I modify the timer?

Varon

Posted 2014-10-16T10:03:35.340

Reputation: 248

Answers

1

Run sudo visudo and on the line

Defaults env_reset

add (separate it with a comma)

timestamp_timeout=0

The line should then look like this:

Defaults env_reset,timestamp_timeout=0

From now on sudo should ask for password every time for any user.

EDIT: You can of course set the timeout to any value.

ejmin

Posted 2014-10-16T10:03:35.340

Reputation: 124