When you run sudo in Ubuntu, your administrative privileges last for 15 minutes by default so you don’t have to type in your password with every command. If that is too long or short for your tastes, you can change it with a simple tweak.
We recently showed you how to make your sudo passwords visible, and in that exploration I discovered another handy tip. If you’d rather not type in your password every 15 minutes (or if you’d rather your computer prompt you more often for security reasons), you can change this timeout value by editing the sudoers settings file. Here’s how: