Creating your user file with Perl
Note that, if you are so inclined, you can manage your user file with Perl, or any other language which has a DB-file module, for interfacing with this type of database. This covers a number of popular programming languages.
The following Perl code, for example, will add a user 'rbowen', with password 'mypassword', to your password file:
use DB_File;
tie %database, 'DB_File', "passwords.dat"
or die "Can't initialize database: $!\n";
$username = 'rbowen';
$password = 'mypassword';
@chars=(0..9,'a'..'z');
$salt = '', map { $chars[int rand @chars] } (0..1);
$crypt = crypt($password, $salt);
$database{$username} = $crypt;
untie %database;
As you can imagine, this makes it very simple to write tools to manage the user and password information stored in these files.
Passwords are stored in Unix crypt format, just as they were in the "regular" password files. The 'salt' that is created in the middle there is part of the process, generating a random starting point for that encryption. The technique being used is called a 'tied hash'. The idea is to tie a built-in data structure to the contents of the file, such that when the data structure is changed, the file is automatically modified at the same time.