Manual account creation


While one usually uses OS-provided utilities to create and delete accounts which perform these various actions automatically, it's useful to understand what these utilities do by going through the process manually.

  1. Create lines in /etc/passwd (and maybe /etc/shadow) to specify the new user's name, uid, gid, home directory, and shell. Usually at this point you have to leave the password field empty unless you can crypt() in your head.
  2. Set the user's initial password (usually using the passwd command).
  3. Create the user's home directory.
  4. Copy in any default account configuration files (often from /etc/skel)
  5. chown, chgrp home directory and its files to user's uid and gid; chmod appropriate permissions.
  6. Add other user files like /var/mail/user, add user to other files like /etc/group for supplemental group memberships, etc.

Most systems also come with utilities like useradd or adduser (or both, confusingly enough) that prompt for information and perform most of these steps automatically. You're more likely to use these for routine account creation, especially if you have to manage a lot of accounts, but knowing the low-level steps they perform is helpful for debugging account problems or customizing the account creation process.

Very large systems may have automated account creation systems (linked to a customer or personnel database) which can automatically add and remove accounts en masse. The University Computing Center runs such a system linked to its student and personnel databases, which allows for automatic account creation for incoming registered students, automatic removal of accounts of people who are no longer affiliated with the University, and manual creation of accounts for students and staff whose accounts were not created automatically.

Next ->


Steve VanDevender
Last modified: Tue Jul 22 12:31:53 PDT 2003