Information Technology Services
Technical Notes
SEARCH:

How to Install and Configure attach
For help or if you have questions or problems, please contact the Solution Center, 195 Durham Center, solution@iastate.edu or call IT Services at 294-4000.

Table of Contents
About attach
System Requirements
Installing attach
Configuring attach
   AFS Mounting
   URL Mounting
Accessing Your AFS Files
LoginHook/LogoutHook Scripts

About attach

attach can perform these functions:

  • mount (*) one or more AFS directories
  • mount one or more server shares

These functions can be combined together or performed separately. When executed at login, attach can be used mount the necessary directories or shares for the user logging in.

The default configuration file will mount your AFS home directory on the Desktop. See the appropriate sections below for instructions on what to modify to alter this default behavior.

(*) AFS directories are not actually mounted. OpenAFS mounts the afs volume and the attach application creates a folder that points to the AFS directory you specify (i.e. a short-cut). Without this short-cut, you would have to browse down deep into the afs volume to get to the AFS directory you wanted to access.

System Requirements

These programs have not been tested on systems prior to Mac OS X 10.2. Therefore, no support will be given for Mac OS X 10.0 and Mac OS X 10.1 systems. If mounting an AFS directory, OpenAFS must be installed and configured. See How to Install and Configure OpenAFS

Kerberos must also be enabled and configured (for Keberos 5).
You may want to also install MIT's Mac OS X Kerberos Extras.
See How to Configure Kerberos.
 

Installing attach

IT Services has put together an installer that will install:

  • the attach configuration file (edu.iastate.attach.plist in ~/Library/Preferences)
  • the detach script and other support programs (in /usr/athena/etc)
  • the (Iowa State based) hesiod configuration file (in /etc)

You can download IT Services' installer from here (116 KB downlaod).

To install, follow these steps:

  1. Double-click on the attach.pkg package installer to install the software required by attach.

  2. Drag the attach application to the Applications folder (/Applications) on your hard disk.

  3. If you want the attach application to execute during login, add the attach application to either your Mac OS X 10.3 Startup Items or your Mac OS X 10.2 Login Items.

  4. If you are mounting AFS directories at login, then you need to configure the system to use the "detach" script (which will unmount the AFS directories at logout).

    If you previously installed pvattach and followed the old instructions to edit the /etc/ttys file to manually to add the "LogoutHook", undo that edit now:

    sudo pico -w /etc/ttys
    

    • change (all as one line):

      console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
      −LogoutHook /usr/athena/etc/pvdetach"
      vt100 on secure window=/System/Library/CoreServices/WindowServer
      onoption="/usr/libexec/getty std.9600"
      

    • to (all as one line):

      console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow"
      vt100 on secure window=/System/Library/CoreServices/WindowServer
      onoption="/usr/libexec/getty std.9600"
      

    We no longer recommend editing the /etc/ttys file directly.

    The "defaults write" command is the preferred method to install login and logout hooks:

    sudo defaults write /Library/Preferences/com.apple.loginwindow \
     LogoutHook "/usr/athena/etc/logouthook"
    

    or download Mike Bombich's LoginWindow Manager. LWM is a GUI replacement for the above step, plus LWM gives you the ability to set other LoginWindow settings.

  5. For Lab Setup Only: move the ~/Library/Preferences/edu.iastate.attach.plist file to /Library/Preferences/.

Configuring attach

The default attach configuration file, edu.iastate.attach.plist, is installed by attach.pkg (if it doesn't already exist). This default configuration will mount the user's home AFS directory on the desktop. You will need to alter attach's configuration file if you do not want this default behavior. The configuration file can be edited by the "Property List Editor" program, from the command line using vi or pico, or by an editor program. The "Property List Editor" program is installed from the Mac OS X Developer's CD.

AFS Mounting

AFS Mounting is defined in the 'AFSMount" section of attach's configuration file.

<key>AFSMount</key>
<array>
  <string>afs local</string>
</array>

One or more <string>afs local</string> statements can be defined.

Where:

  • afs

    • can be ~ that represents the user's AFS home directory,
    • can be ~locker that represents the locker's AFS home directory,
    • can be a fully quailified AFS directory path.

  • local

    • can be ~/path that represents a path in the user's local home directory,
    • can be a fully qualified local directory path.

AFS Mounting Examples:

  • <string>~ ~/Desktop/$USER</string>

    Mount the user's AFS home directory on the user's desktop as "$USER", where "$USER" is replaced by the user's login username.

  • <string>~ ~macosx ~/Desktop/macsox</string>

    Mount the the macosx AFS locker on the user's desktop as "macosx".

URL Mounting

URL Mounting (i.e. AFP, SMB, etc.) is defined in the 'URLMount" section of attach's configuration file.

<key>URLMount</key>
<array>
  <string>url[ local]</string>
</array>

One or more <string>url[ local]</string> statements can be defined. The [ local] part means that local is optional. Do not specify the [ ]'s.

Where:

  • url

    • can be afp://server/share that represents a share on an AFP server,
    • can be smb://server/share that represents a share on an SMB server,
    • can be ftp://server/share that represents a share on an FTP server (mounted read-only)

    The full URL syntax can be specified:

    afp://[username[:password]@]server/share[/path]
    smb://[[domain;]username[:password]@]server/share[/path]
    ftp://[user[:password]@]server/share[/path]

    However, it is not recommended that you store the password in the configuration file. Replace all blanks in ur with the string "%20".

  • local

    • can be ~/path that represents a path in the user's local home directory,
    • can be a fully qualified local directory path.

      local is optional. If not specified, no short-cut folder is created.

URL Mounting Examples:

  • <string>afp://afpserver.fqdn.iastate.edu/volume</string>

    Mount the AFP server's volume. No short-cut folder is created.

  • <string>smb://smbserver.fqdn.iastate.edu/volume/$USER ~/Desktop/$USER</string>

    Mount the SMB server's volume and create a folder on the desktop that points to the user's folder in this volume on this server.

Accessing Your AFS Files

If you are having trouble getting full read-write access to your files on AFS, you may want to set your local uid to match that of your uid that is used on the AFS file system. To ease this process, we strongly recommend you have an Administrator account that is not the same as the one you are using to access the AFS file system.

  • Login with an Administrator account that is not the one you are changing the uid on.

  • Enter the following command in Terminal (/Applications/Utilities/) to find your uid number:
    pts examine net-id
    
    where net-id is your Iowa State Net-Id (or the Net-Id of the AFS user you are chaning the uid of). Write down the "id:" number from the output of this command. This is your new-uid.

  • Run "NetInfo Manager" (/Applications/Utilities/)

    • In the left column, select /

    • In the middle column, select users

    • In the right column, select your net-id

    • Authenticate by clicking the lock icon (on the bottom left-hand corner of the window) that is next to the text that says "Click the lock to make changes".

    • Under the "Property" list, find the line that contains "uid". Write down the "Value" number. This is your old-uid.

    • Double-click the uid value and change it to the new-uid value.

    • Save your changes (Domain -> Save Changes) and quit NetInfo Manager.

  • Enter the following command in Terminal (/Applications/Utilities) to set the appropriate file ownership permissions:

     sudo find / -xdev -user old-uid -print -exec chown new-uid {} \;
    
    replacing old-uid and new-uid in this command with the values that you wrote down.

  • If you have any other drives connected to your machine, enter the above command to correct file ownership permissions there too. But, in place of / in the command use /Volumes/volume-name, where volume-name is the name of the drive.

  • Logout from the Administrator account.

LoginHook/LogoutHook Scripts

A login hook script (/usr/athena/etc/loginhook) and a logout hook script (/usr/athena/etc/logouthook) are installed as part of the attach installer distributed by IT Services. At logout, the folder placed on the desktop by "attach" is deleted by "detach" (the logout hook script calls "detach"). If you don't want this behaviour or if you want to perform additional steps on logout, you can alter the logout hook script. In addition, if you want to perform steps at login, you should alter the login hook script. Both of these scripts are written in Perl.
 

Last updated March 17, 2008
Copyright © 1995-2008, Iowa State University of Science and Technology. All rights reserved.