3.4. LinOTP on Univention Corporate Server UCS 3.1

LinOTP can also run on the Univention Corporate Server (UCS) 3.1. For this you can use the ready made LinOTP debian packages that can be downloaded from the LSE customers portal.

For the installation on the UCS we choose a local MySQL database as token database but you could also use an already running MySQL or PostgrSQL database somewhere in your network.

Note

You should install LinOTP on a UCS member server.

3.4.1. Install MySQL

Install the MySQL server with the following command:

univention-install mysql-server

3.4.2. Install dependencies

The following packages are needed by LinOTP but are not available via the maintained repositories.

python-docutils, python-pylons, python-tempita, python-weberror, python-webob, python-mako, python-nose, python-decorator, python-formencode, python-pastescript, python-pastedeploy, python-paste, python-beaker, python-webhelpers, python-routes, python-pygments, libapache2-mod-wsgi, python-repoze.who, python-pyrad, python-netaddr, python-configobj.

To install these packages we need to set:

ucr set repository/online/unmaintained="yes"

Now we can install all necessary packages:

univention-install python-simplejson python-crypto python-docutils \
python-sqlalchemy python-pylons python-tempita python-weberror \
python-webob python-mako python-nose python-decorator python-formencode \
python-pastescript python-pastedeploy python-paste python-beaker \
python-webhelpers python-routes python-pygments python-ldap python-m2crypto \
libapache2-mod-wsgi python-repoze.who pwgen python-pyrad \
python-mysqldb python-netaddr, python-configobj

If you like to, you can deactivate the installation of unmaintained packages again:

ucr set repository/online/unmaintained="no"

Note

If you deactivate unmaintained packages you also will not get any updates from the debian package repository!

3.4.3. Install LinOTP

Download the LinOTP packages from the customer portal [1].

[1]https://customers.lsexperts.de/download/LinOTP2/2.5.x/squeeze-64bit/

And install the LinOTP packages:

dpkg -i python-qrcode_2.4.2-1_all.deb
dpkg -i linotp_2.5.2-1_all.deb linotp-ee_2.5.2-1_all.deb \
linotp-useridresolver_2.5.2-1_all.deb linotp-useridresolver-ee_2.5.2-1_all.deb \
linotp-smsprovider_2.5.2-1_all.deb

During the installation you will be asked several questions:

  • Do you want to run LinOTP 2 via Apache2? Yes
  • Password for LinOTP ‘admin’ account: <LinOTP admin password>
  • Do you want to create a self signed certificate? Yes
  • What SQL database do you want to use for the token database? MySQL
  • Database hostname: localhost
  • Name of the token database: LinOTP2
  • Database user: linotp2
  • Database users password: <choose a password>
  • Do you want to create the LinOTP 2 database, now? Yes
  • mysql root password: <empty!>

Note

During installation no database root password was set, so you need to leave this empty!

3.4.4. Configure Apache2

As the Apache Port 443 is already used by UCS, you can configure a DNS Alias in the Univention Management Console like linotp. How this can be done, is described in the manual [2].

[2]http://docs.univention.de/handbuch-3.1.html#ip-config:Konfiguration_der_DNS-Daten_in_der_Univention_Management_Console

Now you need to configure the Named Virtual Host in the LinOTP apache config file /etc/apache2/sites-enabled/linotp2. Change the file like this:

ServerName linotp.<your domain>
ServerAlias linotp

Restart the Apache server:

service apache2 restart

3.4.5. Setup FreeRADIUS server

Most Firewalls and SSL VPNs use the RADIUS protocol for user authentication.

So now you need to install the FreeRADIUS server on your UCS:

univention-install freeradius

We need to open the port for FreeRADIUS in the firewall. So add the following to the file /etc/security/packetfilter.d/50_local.sh:

# LinOTP
/sbin/iptables -A INPUT -p "udp"  --dport 1812 -j ACCEPT
/sbin/ip6tables -A INPUT -p "udp"  --dport 1813 -j ACCEPT

and restart the firewall:

service univention-firewall restart

To configure FreeRADIUS for the use with LinOTP please see section rlm_perl.

3.4.6. Configure LinOTP

Now you need to create a UserIdResolver and your first realm.

You probably want to use your user from your LDAP. So you need to create a new LDAP resolver.

Note

The LDAP on the UCS is listening on port 7389, so you need to enter an LDAP-URI like ldap://<yourserver>:7389 or ldaps://<yourserver>:7636.

As BaseDN you should use cn=users,dc=example,dc=com.

As BindDN you can use cn=Administrator,cn=users,dc=example,dc=com.

Note

You need to replace dc=example,dc=com with your domain components.

You also need to set the Attributes like this to find your users in the UCS LDAP:

  • LoginName Attribute: cn
  • Searchfilter: (cn=*)
  • Userfilter : (&(cn=%s))
  • Attribute mapping: { “username” : “cn”, .... }
  • UID Type: dn

Warning

You should create a service account and use this service account!

Please see Configuring UserIdResolvers for further details on how to create your resolver and realm.

Now you are ready to enroll your first token and to authenticate.