ftp.nice.ch/pub/next/unix/hack/defaultuser.README

This is the README for defaultuser.sh [Download] [Browse] [Up]

Date: 		13 Sept 1997
Author: 	TjL <luomat+next@luomat.peak.org>
Version: 	2.0 (previously released as `fiddlepass'

Tired of having to login everytime you reboot?

Ever wish your NeXT would just boot right into your own account (or some account)?

Well, if so, this script is for you.

You may be familiar with the ``me'' account.  When you first install NeXTStep or OpenStep, it
will boot into the ``me'' account.  That's fine if you never connect to the 'net or a LAN
where having an account with no password is a very bad thing.

This script, however, uses a little-known dwrite called the ``DefaultUser'' in root's
preferences for ``loginwindow''.

Assume that your username is ``myaccount''.  Login as root, launch Terminal.app and enter:

	dwrite loginwindow DefaultUser myaccount

You can then use this script.  It is very simple.  When you want to remove the password for
the DefaultUser account, you simply enter:

	defaultuser.sh removepass

You must do this as root, of course.

To bring the password back, use

	defaultuser.sh restorepass

To make it even simpler, I might try something like this in /etc/rc.local:

if [ -x /usr/local/bin/defaultuser.sh ]; then
	/usr/local/bin/defaultuser.sh removepass
	(sleep 60 && /usr/local/bin/defaultuser.sh restorepass) &
fi	

Note: this assumes you have put this script at /usr/local/bin/defaultuser.sh, of course!

That will remove the password, wait 60 seconds, and then restore the password.  That should be
plenty of time to complete the boot action and have the DefaultUser get logged in.  However,
you might want to make it less time since this account will be open during that interval.
 
WARNING: this script removes a password from a user account on your machine, and it mucks with
NetInfo.  If that isn't enough for you to treat it with a lot of care, then you're very
foolish.  Be careful.  I can't be held responsible for what it does to you or your system.

NOTE: Don't use ``root'' as the DefaultUser.... it's just a bad idea.  You don't ever want
root to not have a password, even for just a few minutes.  Remember, if someone comes in and
reboots the machine, they will be able to get into the DefaultUser account.  Convenience comes
with a price.


These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.