The University of Texas at Austin
As part of the Web Central Services Retirement project, the ITS website will be retired. Information about IT services will be replaced by two new sites, IT@UT and UT ServiceNow, and ITS departmental information will be migrated to a new location. All changes will be completed by 7/19/2016.

Austin Active Directory

Example Login Hook Scripts for Mac OS X

These scripts are examples. Full scripts should include error checking and comments.

Example 1

This is the simplest login hook. It returns TRUE, which means all users can log in.

        #!/bin/bash

        echo "ok"

        exit 0

Example 2

This script restricts login to only one user with the EID "joe."

        if test $1 = "joe" ; then

                echo "ok"

                exit 0

        fi

        echo "not ok"

        exit 1

Example 3

This script allows members of the local admin group to login by using the dscl command to check group permissions.

        inGroup=`dscl . -search /Groups GroupMembership $1 | grep admin`

        if test ! "$inGroup" ; then

                echo "not ok"

                exit 1

Example 4

This final example maps arbitrary Active Directory groups to the local administrative group, allowing the resulting set of users to administer the computer.

        theGroup=appserveradm

        inGroup=`dscl . -search /Groups GroupMembership $1 | grep $theGroup`

Last updated June 12, 2012 @ 3:18 pm

We Can Help

Get help from an expert:

* UT Service Desk

* Call us at 512-475-9400

* Submit a help request online

We also have a walk-in service in the first floor lobby of the Flawn Academic Center (FAC). Stop by and let us help you!