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


Comments on this page:

From 74.12.166.148 at 2007-03-23 08:24:26:

If you want /home to be a regular directory as in linux just disable the automounter or comment out /home from /etc/auto_master

By cks at 2007-03-23 09:03:03:

I don't care whether /home is a regular directory or an automounted directory; what I really want is for useradd to work on a default configuration Solaris machine. It doesn't, and that irritates me and forces me to do something.

Since I don't know what else (if anything) counts on /home being automounted, not changing that is the path of least resistance.

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

Page tools: View Source, View Normal, Add Comment.
Search:
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.