What is Usermin?

Usermin is a web interface that can be used by any user on a Unix system to easily perform tasks like reading mail, setting up SSH or configuring mail forwarding. It can be thought of as a simplified version of Webmin designed for use by normal users rather than system administrators. Like Webmin, Usermin consists of a simple web server, and a number of CGI programs which directly update user config files like ~/.cshrc and ~/.forward. The web server and all CGI programs are written in Perl version 5, and use only the non-standard Authen::PAM perl module.

Installation

  • Download from http://www.webmin.com/udownload.html
  • Installing the RPM
    If you are using the RPM version of Usermin, run the command
    # rpm -ihv usermin-0.940-1.noarch.rpm
    Preparing...                ########################################### [100%]
    Operating system is Redhat Linux 7.2
       1:usermin                ########################################### [100%]
    Usermin install complete. You can now login to http://ts1.grape-info.com:20000/
    as any user on your system.
    
    and the install will be done automatically to /usr/libexec/usermin. Users should now be able to login using the URL http://localhost:20000/
  • Download Authen-PAM-0.13.tar.gz for changing password
    # cp Authen-PAM-0.13.tar.gz /usr/local/src
    # tar zxvf Authen-PAM-0.13.tar.gz
    # cd Authen-PAM-0.13
    # CC=gcc perl Makefile.PL
    # make
    # make test
    # make install
    

    Configuration

    Usermin has a lot of functions and initially unnecessary functions are enabled. If you want to control which functions are enabled, edit /etc/usermin/webmin.acl
  • Default
    user: at changepass chfn commands cron cshrc fetchmail file forward gnupg 
    htaccess language mailbox man mysql plan procmail proc quota shell ssh telnet 
    theme
    
  • Enabled only [Change Language], [Read Mail], [Change Password] and [Disc Quotas] functions
    user: changepass language mailbox quota
    
  • Change Password

  • Mail

  • Customize Pages

    If you want to customize pages and/or change messages more friendly, you can change script file directly.

  • To modify the log in page, title ..., edit /usr/libexec/usermin/ulang/en

  • # main_title=Usermin $1 on $2 ($3)
    main_title=Hoge Web Mail
    main_none=You do not have access to any Usermin modules.
    
    category_mail=Mail
    # category_usermin=Usermin
    category_usermin=Category
    category_login=Login
    category_apps=Applications
    
    header_webmin=Usermin Index
    header_config=Preferences
    
    programname=Usermin
    
    feedback_title=Usermin Feedback
    feedback_desc=This form allows you to report bugs on make suggestions to the Use
    rmin developers regarding any problems or missing features that you have found.
    When the Send button is clicked, the details entered into the form will be email
    ed to $1.
    
    # session_header=Login to Usermin
    session_header=Login to Hoge Web Mail
    # session_mesg=You must enter a username and password to login to the Usermin server on $1.
    session_mesg=You must enter a username and password to login to the Hoge Web Mail.
    
  • To modify page header, edit /usr/libexec/usermin/mscstyle3/theme.pl line 84

  • <tr>
      <td width="4" nowrap><img src="/images/top_bar/left.jpg" width="4" h
    eight="32"></td>
      <td width="100%" nowrap><a href="http://www.hoge.com" target="_blank">Hoge</a></td>
      <td><img src=/images/top_bar/top_sep.jpg></td>
      <td width="84" nowrap><a href='$logout'><img src="/images/top_bar/lo
    gout.jpg" width="84" height="31" border="0" alt="$text{'main_logout'}"></td>
      <td width="3" nowrap>
        <div align="right"><img src="/images/top_bar/right.jpg" width="3"
    height="32"></div>
      </td>
    </tr>
    
  • To modify the status bar, edit /usr/libexec/usermin/mscstyle3/theme.pl line 41

  •         "defaultStatus=\"%s%s logged Hoge Web Mail\";\n",
    
  • To remove page footer, edit /usr/libexec/usermin/mscstyle3/index.cgi line 127

  • #    print "<table width=95% align=center><tr><td width=100%><b><font color='#FF
    FFFF'>  ";
    #    print &text('main_version', $ver, $hostname, $ostr),"</font></b>\n";
    #    print "</td>\n";
    
    #print "<td align=right><a href='http://www.msclinux.com/'>",
    #          "<img src='images/theme_by.jpg' border='0'></a>  </div><br>
    #    print "</tr></table>\n";
    
  • To stop changing a samba password, edit /usr/libexec/usermin/changepass/changepass.cgi line 56

  • # Change samba password as well
    # if (&has_command($config{'smbpasswd'})) {
    #        $in{'new1'} =~ s/\\/\\\\/g;
    #        $in{'new1'} =~ s/\'/\\'/g;
    #        $smbout = `$config{'smbpasswd'} '$remote_user' '$in{'new1'}' 2>&1 </dev/
    null`;
    #        }
    
    &header($text{'change_title'}, "");
    print "<hr>\n";
    print "<p>",&text('change_ok', "<tt>$remote_user</tt>"),"<p>\n";
    # if ($smbout =~ /changed/) {
    #        print "<p>",&text('change_samba'),"<p>\n";
    #        }
    #elsif ($smbout) {
    #        print "<p>",&text('change_samba2', "<pre>$smbout</pre> $< $>"),"<p>\n";
    #        }
    
  • To change a messge after changing a password, edit /usr/libexec/usermin/changepass/lang/en

  • index_title=Change Password
    index_desc=Use this page to change the password you use for logging into
    index_for=Changing for user
    index_old=Current password
    index_new1=New password
    index_new2=New password again
    index_change=Change Now
    index_return=password changing form
    
    change_err=Failed to change password
    change_title=Changed Password
    # change_ok=Your password for $1 has been changed successfully. Any telnet, SSH,
     FTP or POP3 logins made from now on will require the new password.
    change_ok=Your password for $1 has been changed successfully.
    change_enew1=Missing new password
    change_enew2=New passwords are not the same
    change_eold=Old password is incorrect
    change_epam2=PAM error : $1
    change_samba=Your Samba password for windows file sharing has also been changed.
    change_samba2=However, your Samba password was not changed : $1
    change_ecmd=$1 failed : $2
    change_epam=The Authen::PAM perl module is not installed. This module must be co
    nfigured to use an external passwd program instead.
    
  • To change a disc quotas page, edit /usr/libexec/usermin/quota/index.cgi line 12

  •         print "<table border width=100%>\n";
            print "<tr $tb> <td><br></td>\n";
    #       print "<td colspan=3 align=center><b>$text{'ufilesys_blocks'}</b></td>\n
    ";
            print "<td colspan=3 align=center><b>Usage</b></td>\n";
    #       print "<td colspan=3 align=center><b>$text{'ufilesys_files'}</b></td> </
    tr>\n";
    #       print "<tr $tb> <td><b>$text{'ufilesys_fs'}</b></td>\n";
            print "<tr $tb> <td><b>\\</b></td>\n";
            print "<td><b>$text{'ufilesys_used'}</b></td> <td><b>$text{'ufilesys_sof
    t'}</b></td>\n";
            print "<td><b>$text{'ufilesys_hard'}</b></td>\n";
    #       print "<td><b>$text{'ufilesys_used'}</b></td> <td><b>$text{'ufilesys_sof
    t'}</b></td>\n";
    #       print "<td><b>$text{'ufilesys_hard'}</b></td> </tr>\n";
            for($i=0; $i<$n; $i++) {
                    $f = $filesys{$i,'filesys'};
                    print "<tr $cb>\n";
                    print "<td>$f</td>\n";
                    print "<td>$filesys{$i,'ublocks'}</td>\n";
                    &print_limit($filesys{$i,'sblocks'});
                    &print_limit($filesys{$i,'hblocks'});
    #               print "<td>$filesys{$i,'ufiles'}</td>\n";
    #               &print_limit($filesys{$i,'sfiles'});
    #               &print_limit($filesys{$i,'hfiles'});
                    print "</tr>\n";
                    }
            print "</table><br>\n";
    
  • To remove server-side attachments, edit /usr/libexec/usermin/mailbox/reply_mail.cgi line 250

  • # if ($config{'server_attach'}) {
    if (0) {
    
  • To modify "From address" at the compose page instead of showing hostname+domain, edit /usr/libexec/usermin/mailbox/reply_mail.cgi line 122

  •         # Make on From: address
    #       $hostname = $config{'server_name'} ? $config{'server_name'}
    #                                          : &get_system_hostname();
            $hostname = 'hoge.bt';
    

    Back
    Google
    Web www.grape-info.com