Cool Solutions

Add/Delete Users


August 22, 2005 7:54 am






Download user_add_del

One problem that faces many College Linux administrators at the start of a new academic session is the creation of student logins. I wrote this tool to automate the process for me. creates the logins and allows you to clean up the logins when the class is finished. The second script, the delete script, relies on the naming convention used when the logins were created.

Our login names are based on the class name plus an index number. The script can be easily modified to reflect the naming convention used in your organisation (see comments). An initial password, the same as the user name, is assigned to the login.

The script also creates a test web page for the student’s web design area (this assumes that you have the UserDir directive included in your Apache web server’s configuration file).

Run this script with three parameters:

  1. The class name
  2. The starting number
  3. The end number

for example, to create 20 logins for class F051T use:

./useradd f051t 1 20

The script was created to clear out student accounts at the end of the academic year.

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.

Categories: Uncategorized

Disclaimer: This content is not supported by Micro Focus. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.