Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Mac OS X 10.7.5. In previous versions of MacOS X, there would be a guest account created from a template when a guest wanted to use the computer, and then the files would be destroyed upon logout. If I remember correctly, the user was also sandboxed so they couldn't access any of the other files (this may be wrong).

In any case, I'm using FileVault2 on my MacBook Air. I still want to provide guests access to our computer, but the current guest mode is deficient in the following ways:

  • It doesn't run at native resolution. Instead of 1920x1080, it runs at something lower.

  • It doesn't auto-connect to my wifi network. This means my guest has to re-enter credentials every time they login.

  • It does a reboot and then logs in. I realize this is a security measure in case the computer gets stolen.

So my first question is this: Is there a way to modify the default guest experience to run at native video resolution and remember wifi connected networks? I'm quite comfortable with the command line. I used to edit the template in "/System/Library/User Template/" to achieve the effects I wanted in the default guest.

If not, my next option is to create my own "guest" user. I'd like to use a logout hook (I googled it). Are there suggestions on how to configure this 'guest' account? One question I have is what would be an appropriate group to assign this temporary user too. I'd also like to invoke similar templating behavior on login and logout. Is it possible to invoke the login/logout script on a per user basis? Or does the script itself need to incorporate this logic? (i.e. do I need a if [-user 'temp'] blah blah).

share|improve this question

Try this: Create a user TestGuest. Configure it the way you want. Create a user visitor.
In your own terminal window type "id visitor"

You will get a return something like this:

uid=504(visitor) gid=20(staff) groups=20(staff),404(,402(,12(everyone),61(localaccounts),403(,405(

You may want to compare this to the guest account to see what groups guest is normally lacking, compared to visitor.

Check the owner and group of all files in the regular guest account. See if these are anything other than guest and whatever group guest is a member of.

As an admin, you can change the groups that TestGuest and Visitor are member of.

Create a script. This script checks to see of visitor is logged in, and if it doesn't it does the following:

A: rsync between TestGuest and visitor.

B: change ownership and group of visitor to match the real visitor.

C: Put a flag file that indicates a fresh visitor install

Once you get this script working to your satisfaction, add a test to see if visitor is logged in. If visitor is logged in, it checks for the existence of a flag file. If that file is there, it is removed, and the script exits. If the visitor is not logged in, it checks for the flag file, and if does the rsync, adds the flag file, and exits. If the flag file is there, it exits.

Fresh Creation of visitor account Fresh Flag in place Visitor Logs in Fresh Flag removed Visitor Logs out No Flag, so visitor account is recreated.

The idea is that the flag tells the script if it has run since visitor last logged in or out.

You can check for login with "last | grep console" which will show you all logged in window users. Look for "still logged in"

You can do tests for this by enabling multiple logins.

Once you get the script working properly running manually after the visitor logs in and out, then create a cron job that runs as root that runs every 2 minutes.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.