7.7. Login Hooks

As discussed earlier, login and logout hooks provide the means to run scripts prior to and after a user's login session. Here, the term "hook" is synonymous with "script." The term hook is used simply as a colloquialism referring to the manner in which the script is caught by the login or logout processes. Login and logout hooks are functionally identical, so you will use the term login hook going forward. Unless otherwise indicated, information is similarly applicable to logout hooks.

Login hooks are executed under uid 0. That is, they run with root privileges. In order to properly identify the user environment in which they are running, the system passes the logging-in-user's short name as the first argument to a login script. ...

Get Enterprise Mac Administrator's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.