How To Secure Apache2 With LinOTP
|
Submitted by cornelinux (Contact Author) (Forums) on Wed, 2012-10-31 19:13. :: Debian | Ubuntu | Web Server | Apache | Security
How To Secure Apache2 With LinOTPThis Howto describes the way to set up two factor authentication with one time passwords for Apache2. We assume, that you have already set up your LinOTP server. You can download Debian and Ubuntu packages or you can install the system using the Python Package Index. It provides a good quick start to get the service up and running for demo purposes (check for the latest version).
DownloadThe OTP authentication is done using a Apache authentication provider for Apache basic authentication. This provider can be downloaded at github. Or you can download the package directly at your command line: wget https://github.com/lsexperts/mod_authn_linotp/zipball/master -O mod_authn_linotp.zip
InstallYou need at least the following packages on your Ubuntu or Debian system to compile the Apache module: dpkg -i libtool automake autoconf build-essential libcurl4-gnutls-dev Now unzip the module and enter the directory:
unzip mod_authn_linotp.zip The installation process is also described in the file INSTALL:
libtoolize You can also use checkinstall to create a debian package for easier package handling. sudo checkinstall make install Now the module is located at /usr/lib/apache2/modules/mod_authn_linotp.so.
Activate the modulesudo a2enmod authn_linotp
Configure ApacheNow you can use two factor authentication for your Apache directories and locations. You can also take a closer look at the file README for all the configuration parameters. The module uses cookies to cache the successful authentication. The cookie is encrypted, so you need to create a secret: pwgen 24 1 Now you can protect any Directory or Location scope like this: <Directory />
AuthType basic
AuthName "LinOTP protected"
AuthBasicProvider LinOTP
Require valid-user
LinOTPValidateURL https://172.16.200.148/validate/simplecheck
LinOTPCookieSecret eenohJaen6CeexaH9yieTiel
LinOTPSSLCertVerify Off
LinOTPSSLHostVerify Off
</Directory>
Using LinOTPTimeout you can define for how many seconds the cookie should be valid and thus after which time the user should be asked for a new OTP again. Please note: Using localhost in you LinOTPValidateURL might lead to curl errors, so please either use the correct IP or FQDN. Happy Authenticating!
|



Recent comments
1 hour 1 min ago
2 hours 1 min ago
5 hours 48 min ago
7 hours 2 min ago
10 hours 38 min ago
17 hours 53 min ago
1 day 2 hours ago
1 day 4 hours ago
1 day 19 hours ago
1 day 21 hours ago