Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Speed up sudo operations UNIX
The "sudo" command on Jaguar takes almost a second to launch which can be annoying. This is due to the connection to the security server. To revert to the 10.1 behavior, edit (using sudo) the file /etc/pam.d/sudo. Comment out the "" (second) line, so it looks like:
 #auth       sufficient
The "sudo" command is now effectively instant! The effect is immediate and very noticeable.

[Editor's note: Editing this file as root with sudo in vi, I had to use "w!" to force the file to be written, as the default permissions do not give root write access! Also, this would probably be a good spot to say something like "Disabling access to the security server may compromise your machine's security." Does anyone know for certain what impact, if any, disabling this check may have?]
  • Currently 1.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)

Speed up sudo operations | 9 comments | Create New Account
Click here to return to the 'Speed up sudo operations' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
I think its ok
Authored by: bhines on Jan 15, '03 12:08:18PM

From what i understand, this might make sudo not work if you completely disable netinfo. (the 10.1 behavior). I got the tip from an Apple engineer, so i trust him. :) I don't think many people run OS X without netinfo, though it is apparently possible.

[ Reply to This | # ]
I think its ok - NOT
Authored by: pjdodd on Apr 04, '04 12:31:10PM


I have commented out the line as stated and now i cant sudo in shell or with certain applications....i cant restore the write permissions to sudo file in pam.d and running out of patience and option.

Im on Panther 10.3.3.

[ Reply to This | # ]
Works for me
Authored by: bluehz on Jan 15, '03 12:15:49PM

This is great tip and works as described - sudo/password is almost instantaneous again. I would be interested in knowing the security implications of doing the above prescribed action - if anyone with more knowledge in this area could chime in.

[ Reply to This | # ]
Works for me
Authored by: tsugaru on Jan 15, '03 02:11:34PM

I don't really mind the one second wait for sudo. Yay. A second.

I'm sure for people who don't use sudo a lot, this is no big deal. But if you are a unixhead and NEED that second back, then go for it.

I find this a good hint, but I am not one to disable security server authenication just to save a second.

[ Reply to This | # ]
Works for me
Authored by: SeanAhern on Jan 15, '03 02:39:59PM

Agreed. Especially when "sudo -s" gives you an authenticated shell that has no delays.

[ Reply to This | # ]
Works for me
Authored by: bhines on Jan 15, '03 03:13:40PM

The thing is, all this does is revert you to the 10.1 behavior - you don't lose anything, really.

[ Reply to This | # ]
Works for me
Authored by: zedwards on Jan 16, '03 02:14:52PM

That is, if this hint is really reverting to 10.1 behavior...kinda risky, in my book.

[ Reply to This | # ]
thank you!
Authored by: huzzam on Jan 15, '03 05:01:28PM

you know, this has driven me batty since upgrading to jaguar. i reinstalled twice thinking something was broken. I'd even asked on the forums & gotten the general response: "works fast for me."

& no, this doesn't decrease security at all, it just removes one possible method of authentication.

[ Reply to This | # ]

Speed up sudo operations
Authored by: JBHemlock on Apr 07, '03 01:46:19PM

This works really nicely. FWIW, this same fix also works for 'su' (find the line referencing the security server that you commented out for the sudo fix).

[ Reply to This | # ]