Installing Usermin is just about like installing Webmin, with the one exception that it is recommended to install the Authen-PAM Perl module before installation of Usermin. So first it will be necessary to check for, and possibly install this Perl module. The easiest way to check for a Perl module is to use a command like the following:
[root@grover root]# perl -e 'use Authen::PAM; print "success!\n"'
The result if this module is available will simply be the word "success!" printed on the next line. If the module is not installed, a number of errors will result instead. If you have success with the module check, proceed to the next section. If not, visit the Comprehensive Perl Archive Network (CPAN for short) at www.cpan.org. Use the search function to find the latest version of Authen-PAM, download it and follow the instructions in the README file that is included. Briefly, all CPAN Perl modules are installed in the same simple way.
First generate a makefile by running the Makefile.PL file, as below:
[root@grover Authen-PAM-0.13]# perl Makefile.PL
If successful, run make and make install
[root@grover Authen-PAM-0.13]# make [root@grover Authen-PAM-0.13]# make install
Next, use the Perl command suggested at the beginning of this section to test for the availability of the module. Then add a PAM service called usermin in the appropriate location. Under many Linux distributions, this involves creating a file named /etc/pam.d/usermin containing the following:
#%PAM-1.0 auth required pam_unix.so shadow nullok account required pam_unix.so password required pam_unix.so shadow nullok use_authtok session required pam_unix.so
Now installation of Usermin should proceed smoothly.
You may be able to download a package of Authen-PAM for your operating system, which is usually preferable from a system maintenence perspective. Also, if you use an RPM based Linux distribution, you may be able to use cpanflute to automatically generate a package from the Perl module, if your vendor doesn't provide a package for you. The use of cpanflute is well out of the scope of this book, but it is worth looking into if you frequently install Perl modules as it makes generating module RPMs a simple and painless process.
Lucky for us, Usermin is free under a BSD style license, just like its more powerful sibling. It can be downloaded for free from the Webmin site or one of its mirrors. For reference the primary Webmin site, again, is www.webmin.com. Like Webmin, Usermin is available in a tarball, as well as an RPM for Red Hat, MSC Linux, Caldera, Mandrake and SuSE. Unlike Webmin, there is currently no Solaris pkg package of Usermin. Choose the most appropriate option for your system.
Depending on installation method, you will follow similar steps to that of installing Webmin. For the tarball, copy it to the desired installation location (usually /usr/local), unzip it, untar it and run the install.sh script.
[root@delilah /root]# cp usermin-0.6.tar.gz /usr/local [root@delilah /root]# cd /usr/local [root@delilah local]# gunzip usermin-0.6.tar.gz [root@delilah local]# tar xf usermin-0.6.tar [root@delilah local]# cd usermin-0.6 [root@delilah local]# ./setup.sh
The install script will ask a series of questions, most of which are usually safely left at their default values. After the installation script finishes running, you will be able to log in to the Usermin server on port 20000.
Installing from an RPM package is, just like with Webmin, even easier than installation from the tarball. When installing from a package it is still necessary to check to insure you have the PAM Perl module as documented previously, if you will be using it. Then use the following command for an RPM installation:
[root@delilah /extra]# rpm -Uvh usermin-0.6-1.noarch.rpm
The RPM will automatically run the installation script with sensible defaults and start the Usermin server on port 20000.