Change the sudo Password Timeout in Ubuntu

In Ubuntu (and any other Ubuntu-based distro), when you use a “sudo” command, the system will prompt you for your password. After the first “sudo” command, the system will remember your password for the next 15 minutes so you don’t have to enter any more password for subsequent “sudo” command. If, however, you feel that the 15 minutes is a bit too long/short, here is how you can change it.

1. Open a terminal and type:

2. In the file that open, scroll down till you see the line:

Change it to

where X is the time (in minutes) that the sudo password will timeout. You can set X to the value you want.

visudo-edit

Note:

  • If you set X to “-1”, it will revoke the password prompt, which is not advisable.
  • If you set X to “0”, the system will prompt you for password everytime you use the “sudo” command

3. Press “Ctrl + x” to exit. Don’t forget to press “y” to save the changes.

Damien Damien

Damien Oh started writing tech articles since 2007 and has over 10 years of experience in the tech industry. He is proficient in Windows, Linux, Mac, Android and iOS, and worked as a part time WordPress Developer. He is currently the owner and Editor-in-Chief of Make Tech Easier.

One comment

Comments are closed.