SOHO : Small Office Home Office
Freeware - Opensource software tips, tricks, tweaks & fixes for managing, securing, improving the performance of SOHO Desktop, Laptop, Networks

Monday, July 5, 2010

How to setup Webmin in SSL mode (https)?


Because your Webmin login and password are normally passed between your browser and the server in unencrypted form, an attacker with access to any of the networks between the browser and server can easily capture your Webmin login. To prevent this, Webmin can be configured to use SSL to encrypt all of its network traffic.

Running Webmin in SSL mode

To install SSL, follow these steps :


  1. Download the OpenSSL library
    OpenSSL is a C library that provides the underlying SSL functions used by Webmin and many other programs. It is available in RPM format and as a .tar.gz file. When installing from the RPM, you may also need thedevelopment RPM in order to compile Net::SSLeay. 
    Most Linux and BSD distributions now come with OpenSSL RPMs that are installed as standard or available on the CD. If your distribution hasopenssl and possibily openssl-devel packages, use them instead.

  2. Install the OpenSSL library
    If you are installing from the RPM, run the commands :
      rpm -i openssl-0.x.y.rpm
      rpm -i openssl-devel-0.x.y.rpm

    If installing from the source, you will need to compile and install it with the commands :
      tar xvzf openssl-0.x.y.tar.gz
      cd openssl-0.x.y
      ./Configure     (or ./config in new OpenSSL versions)
      make
      make install
  3. Download the Net::SSLeay Perl module
    Net::SSLeay is a module that allows Perl scripts to call the functions in the OpenSSL library. It is available in .tar.gz format from the Webmin siteor from the CPAN Perl module archive
    Alternately, you can use the Perl Modules module in Webmin to download an install Net::SSLeay from CPAN. If this works OK, the next step can be skipped. 
    Some Linux distributions come with an RPM package containing this Perl module, often named perl-Net-SSLeay. If one is available, install it instead of compiling the module manually. You may also be able to find a suitable package at rpmfind.net if your distribution doesn't include one. However, be aware that any Perl module in RPM format must have been built for the same version of Perl that you are running, or it won't work.

  4. Install the Net::SSLeay module
    To install the module, use the commands :
      tar xvzf Net_SSLeay.pm-x.yy.tar.gz
      cd Net_SSLeay.pm-x.yy
      perl Makefile.PL
      make install

    If you have installed OpenSSL from the RPM, you may need to run perl Makefile.PL /usr in order to find the OpenSSL library properly.

  5. Test the SSL install
    If the command perl -e 'use Net::SSLeay'doesn't output any error message, then the SSL support that Webmin needs is properly installed.

  6. If Webmin is not installed yet, install it
    If you install SSL support first, when Webmin'ssetup.sh script is run it will ask you if you want to enable SSL. Just enter y. The RPM version of Webmin will always automaticlly use SSL mode if possible.

  7. If Webmin is already installed, turn on SSL
    In the Webmin Configuration module (under the Webmin category) an icon for SSL Encryption should appear. Click on it, and change the SSL option from Disabled toEnabled.

No comments:

Post a Comment