I setup a private IRC server today on an Ubuntu 12.04LTS machine, but ran into some frustrations in the process. Hopefully, this can simplify the process for you.
The process of adding many users to a new Linux system can get tedious, especially if it is involved. So, let's replace the process with a simple shell script.
For this example, public keys are the only allowed login method. Password login is disabled, so the password is not set. The first step is to run set -e to stop the script on any errors. Next assign readable variable names, and check they aren't null. Next the user is created, and as the user the public keys are setup.