Adduser

From Livedoc - The Documentation Repository
Jump to: navigation, search

Overview

Adduser is one of the Perl scripts involving adding users to the CSL system. Currently, it must be run on fiordland as root, and after authenticating with admin privileges (hopefully after running pagsh, as well). It performs these basic tasks:

  • Creates a user's Kerberos principal
  • Creates a user's OpenAFS Protection Server entry
  • Adds an NIS entry for the user
  • Creates the user's home directory volume
  • Adds skeleton files and directories in their home directory, and sets the proper permissions on all of them

Other Scripts

There are a couple of other scripts which provide a similar functionality as adduser. These are adduser-file and adduser-haa. The adduser-haa script adds a user under the Half Admin Access system, and adduser-file adds a user using a file, instead of asking for information from a prompt. The file format is similar to passwd format, and looks like this:

 username:password:gradyear:Real Name
 otheruser:password2:2007:Other User
 adeason:yeahright:2006:Andrew Deason

Each user gets their own line, and each line has four fields, delimited by colons (graduation year should be set to 1984 any non-student accounts). Run adduser-file <filename> where <filename> is a file in the format described above, and it will create accounts for those people. If any step fails, it gives you the option of resuming or aborting.

Improvements

As of the time of this writing, the adduser suite of scripts are not very well coded, and could use a serious rewrite. It is planned that they will be completely re-written, possibly with some added functionality. Some ideas are:

  • Make a library of CSL-specific things to run, providing functions such as add_nis() or is_valid_pass(), so we don't have to repeat code. This would be something like a module in Perl or Python, or whatever language the scripts turn out to be in.
  • Have the scripts somehow determine what server to add the user volume to, probably based on the amount of free space. (Or at least prompt the user, or something.)
  • Integrate scripts to add/remove websites, users, and MySQL accounts (right now those are three separate scripts in two different languages).
  • Add the functionality to actually remove accounts, MySQL accounts, or websites.
  • Have the script optionally send out account creation emails on it's own. Those emails are very annoying to write.
  • Consider changing the language of the scripts themselves (currently Perl), maybe to Python, since it gives much of the same functionality as Perl, but is less ugly. (And making a module for it is easier.)

Authors

The original adduser script was written by Jeffrey Grafton. It was later modified by Andrew Deason, who is also the author of the other adduser scripts.