How can homebrew install use sudo without password?


(Zsolt Ero) #1

I am just wonder about the following.

  1. Homebrew install does not ask any kind of sudo password
  2. Yet homebrew install runs commands with sudo, such as:
/usr/bin/sudo /bin/mkdir -p /usr/local

When /usr/local doesn’t exist.

How can it do this? The local folder gets owned as root and later on I need to use sudo to remove it. How can it magically get sudo permissions without password?


(Zsolt Ero) #2

OK, it was just remembering sudo password across sessions. sudo -K made it ask for it again.