Wandering Thoughts archives

2007-03-22

Making user home directories on a stock Solaris machine

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.)

MakingUserHomedirs written at 18:35:02; Add Comment


Page tools: See As Normal.
Search:
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.