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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.