Become The Solution Chicago Logo

How To: Mac Change SUDO Timeout

How To: Mac Change SUDO Timeout

If you use Terminal and are often using sudo commands, you can increase the sudo password timeout so you aren’t prompted so often to re-enter your password for certain sudo commands. We will need to edit the sudoers file in /etc/. Follow the below steps.


1. Open Terminal (Applications -> Utilities -> Terminal) 

2. Type the following command and hit return.

sudo visudo

3. Use your arrow key and go down to the bottom of this file we are editing pictured below.

Mac terminal sudo timeout sudoers file

4. Insert a new line – type s or something then hit return to start the new line. You can enter the following lines that will do the following. The timeouts are based on minutes.

(No password caching)
Defaults timestamp_timeout=0
(10 minute password caching)
Defaults timestamp_timeout=10 
(Infinite cache, only need to enter password once)
Defaults timestamp_timeout=-1 

5. In this example, we will use 10 minutes for our password caching

Defaults timestamp_timeout=10

6. Once you typed in the line, hit Escape (ESC). Then type Colon : and finally type wq and hit return to save changes.

7. You can repeat step 2 to verify your sudoers file is saved with your updates.

8. In order for your updates to take affect, re-launch Terminal.


To learn more about sudo and the sudoers file, type

man sudoers
in Terminal. You can learn to add specific sudo limits to Mac user accounts as well.


* Please use the comment form belowFor LIVE chat updates, use the SHOUT BOX below.*


Related Posts



No comments made yet. Be the first to submit a comment
Saturday, 15 December 2018

Shout Box!

HelenV - 12/12/2018 - 08:32

just got msg on my 7plus that someone is trying to sign in with my apple id in Nanjing, Jiangsu and I am in Athens Greece. Good thing I have 2 factor.

Alex - 11/12/2018 - 16:29

My TT-BH040 won't pair with another device besides my iPhone. I'm trying to pair them with my Windows 10 laptop.

iphone user - 10/12/2018 - 13:36

iphone xs max sometimes after unlocking does not switch horizontal to vertical view. I usually end up powering off and on. Latest iOS .12.1.1

Anonymous - 05/12/2018 - 23:17

Where can I get this App?

Mike - 05/12/2018 - 23:17


User - 26/10/2018 - 08:55

Have been habving this issue last hour. Unreal hinge is trash

Follow Us Online!
Become The Solution Facebook PageBecome The Solution Twitter Solution ChicagoBecome The Solution Google PlusBecome The Solution InstagramBecome The Solution LinkedInBecome The Solution YouTube

Subscribe to Become The Solution!