Making user home directories on a stock Solaris machine

March 22, 2007

I was charmed to recently discover that Solaris 10 still hasn't fixed that useradd issue I saw with Solaris 9. For my future reference, since I am likely to wind up doing this a lot, here is how I add users on Solaris 10; this may or may not be the officially approved way to work around the useradd issue.

  1. useradd -c Whatever <login>
  2. mkdir /export/home/<login>
  3. chown <login> /export/home/<login>

    (This may or may not get the group ownership right. It's hard to care.)

  4. set the login's initial password with: passwd <login>
  5. now, edit /etc/auto_home to add a line saying:
    <login> localhost:/export/home/&

    Usefully, you don't need to restart any daemons to get this to take effect.

Theoretically you can now log in to the new account and copy the default dotfiles from /etc/skel to your home directory, but as far as I can see they don't actually have anything useful so you're not actually missing anything. (Certainly they don't set a useful Solaris $PATH.)

If you want to skip all of this at the cost of some ugliness in home directory location, just manually specify that the new user's home directory is /export/home/<login> with useradd -d. I may wind up doing this for expendable VMWare installs of Solaris, since it's faster and less annoying.

(Also for my future reference, the index that man -k needs on Solaris 10 is created with catman -w.)

Written on 22 March 2007.
« Users are almost always right
An irony of conditional GET for dynamic websites »

Page tools: View Source, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Thu Mar 22 18:35:02 2007
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.