How to make sudo session longer in Linux

sudo session longer

Are you bored to type your password everytime you execute a sudo command? By default when you use the sudo command, your administrative privileges last for 15 minutes and then you will need to type your password again. You can set the sudo session to last longer with this simple tweak.

# sudo visudo

Then search for this line:

Defaults        env_reset

and add the timestamp_timeout variable. You can set the sudo session to last for 60 minutes. It should look like this:

Defaults        env_reset,timestamp_timeout=60

You can set the timestamp_session to -1 if you dont want to be asked for a password, or 0 if you want to be prompted for your password everytime when run sudo.

- Posted by Eva to Linux
tags: sudo