Thursday, May 7, 2009

Prevent Linux from remembering sudo password

By default, Linux remembers the sudo password for some time. i.e. if you run a command using sudo command, first time it will ask you for sudo password, but if you sudo it again within some seconds, Linux is not going to prompt you for sudo password.

If you are worried about this due to any security concern or so and you want Linux to prompt for sudo password every time you use sudo to run a command, the following can be done.

$ sudo visudo

Enter the following in the default section

Defaults timestamp_timeout = 0

and save the file and you are done.

** The value 0 in the above line can be replaced with any "minutes" for which sudo password has to be remembered.

1 comment:

atoztoa said...

Nice tip :)


© Jadu Saikia