Modify sudo session in Ubuntu

In Ubuntu, whenever you run sudo in front of any command, it has session which is last about 15 minutes by default in Ubuntu. So you don't have to rewrite the same password every time you need to use sudo command.


To modify this settings, open Terminal and write followings.

sudo visudo


Now look for this

Defaults          env_reset



Now change it to

Defaults          env_reset,timestamp_timeout=X


The X is the time in minutes that the sudo password will expire.

If you set X to 0, the system will prompt you for the password every time you use the sudo command.

Comments