<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ubuntu &#8211; privacyID3A</title>
	<atom:link href="https://www.privacyidea.org/category/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.privacyidea.org</link>
	<description>flexible, Open Source Multi Factor Authentication (2FA)</description>
	<lastBuildDate>Tue, 24 Mar 2020 18:00:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.5</generator>

<image>
	<url>https://www.privacyidea.org/wp-content/uploads/2016/06/cropped-only-logo-white-background-32x32.png</url>
	<title>Ubuntu &#8211; privacyID3A</title>
	<link>https://www.privacyidea.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Versatile 2FA Single Sign-On with Keycloak and privacyIDEA</title>
		<link>https://www.privacyidea.org/versatile-2fa-single-sign-on-with-keycloak-and-privacyidea/</link>
					<comments>https://www.privacyidea.org/versatile-2fa-single-sign-on-with-keycloak-and-privacyidea/#comments</comments>
		
		<dc:creator><![CDATA[Henning Hollermann]]></dc:creator>
		<pubDate>Tue, 24 Mar 2020 17:53:00 +0000</pubDate>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[2FA]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[keycloak]]></category>
		<category><![CDATA[kolab]]></category>
		<category><![CDATA[OpenID Connect]]></category>
		<category><![CDATA[privacyIDEA]]></category>
		<category><![CDATA[Roundcubemail]]></category>
		<category><![CDATA[SSO]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=1772</guid>

					<description><![CDATA[The integration of privacyIDEA with Keycloak to provide a solid basis to secure your applications with a second factor in a single sign-on (SSO) environment. For maximum flexibility, the system relies on standard protocols such as SAML or OpenID Connect (OIDC). This article shows exemplarily the integration of Keykcloak, privacyIDEA and Kolab.]]></description>
										<content:encoded><![CDATA[
<p>In a <a href="https://netknights.it/en/single-sign-on-with-privacyidea/">previous article</a>, we wrote about benefits and risks of single sign-on (SSO) in enterprise environments and how a solid 2-factor-authentication solution as provided by privacyIDEA helps reduce risks. In this article we will demonstrate how to setup a SSO system with <a href="https://www.keycloak.org/">Keycloak</a> and <a href="https://netknights.it/en/produkte/privacyidea/">privacyIDEA</a>. As an example application we integrate the <a href="https://kolabsystems.com/">Kolab Groupware Server</a> and setup the Roundcubemail webmailer to authenticate with OpenID Connect (OIDC) and a second factor managed by privacyIDEA. Other popular collaboration platforms such as <a href="https://www.tine20.com/en/">Tine 2.0</a> or <a href="https://www.open-xchange.com/">Open-Xchange</a> and many other applications will also work with Keycloak and privacyIDEA as long as they support at least one standard SSO protocol.</p>



<div class="wp-block-image is-style-default"><figure class="aligncenter size-large is-resized"><img decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/03/network-987x1024.png" alt="" class="wp-image-1932" width="600" srcset="https://www.privacyidea.org/wp-content/uploads/2020/03/network-987x1024.png 987w, https://www.privacyidea.org/wp-content/uploads/2020/03/network-289x300.png 289w, https://www.privacyidea.org/wp-content/uploads/2020/03/network-768x797.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/03/network.png 1100w" sizes="(max-width: 987px) 100vw, 987px" /></figure></div>



<p>First, we setup three machines with Ubuntu Server 18.04 and provide similar /etc/hosts files to each of them. For a proper setup, Kolab requires a fully qualified domain name. We choose <code>kolab.netknights.it</code>.</p>



<pre class="wp-block-preformatted has-small-font-size">127.0.0.1      localhost
127.0.1.1      kolab
192.168.56.200 kolab.netknights.it    kolab
192.168.56.201 pi.netknights.it       pi
192.168.56.202 keycloak.netknights.it keycloak</pre>



<p>To put the system into action, one would have to configure DNS and NAT  properly so that the server is reachable from the internet. DNS record  of type A, AAAA and MX are crucial to do this. You may read about this  requirement in the Kolab docs &#8220;<a href="https://docs.kolab.org/installation-guide/preparing-the-system.html">preparing the system</a>&#8220;. For this proof of concept we will not use any logical volumes nor discuss firewall setups or SSL transport layer security.</p>



<p>After updating the initial Ubuntu Server systems, we install privacyIDEA, Keycloak and Kolab following their general installing instructions. We start with Kolab, since in this scenario, we would like to attach the ds-389 LDAP directory delivered by Kolab to our backend, i.e. Keycloak and privacyIDEA.</p>



<h3 class="wp-block-heading">Kolab 16 Installation</h3>



<p>The primary OS supported by Kolab is CentOS, which is also supported by privacyIDEA. However, there are also Kolab and privacyIDEA packages available for Ubuntu 18.04. We will use these for our setup. The install instructions can be found at <a href="https://docs.kolab.org/installation-guide/ubuntu-18.04.html">docs.kolab.org</a>. We summarize them here for convenience</p>



<pre class="wp-block-preformatted has-small-font-size"># Add repositories for apt to /etc/sources/ 
~$ echo 'deb http://obs.kolabsys.com/repositories/Kolab:/16/Ubuntu_18.04/ ./ deb-src http://obs.kolabsys.com/repositories/Kolab:/16/Ubuntu_18.04/ ./' \ 
| tee /etc/apt/sources.list.d/kolab.list 
# Add signing key 
~$ wget -q -O- https://ssl.kolabsys.com/community.asc | apt-key add - 
~$ echo -e 'Package: *\nPin: origin obs.kolabsys.com\nPin-Priority: 501' \ 
| tee /etc/apt/preferences.d/kolab 
~$ apt-get update
~$ apt-get install kolab</pre>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img fetchpriority="high" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/01-install-kolab-terminal-1.png" alt="" class="wp-image-1784" width="733" height="194" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/01-install-kolab-terminal-1.png 733w, https://www.privacyidea.org/wp-content/uploads/2020/02/01-install-kolab-terminal-1-300x79.png 300w" sizes="(max-width: 733px) 100vw, 733px" /></figure></div>



<p>We let the postfix SMTP service be configured as &#8220;Internet with smarthost&#8221;. Outbound email will be relayed to another (trusted) mail server, e.g. the one of your ISP. Inbound mail will reach postfix on port 25 if your DNS records are configured correctly. After installation the configuration script is called via</p>



<pre class="wp-block-preformatted has-small-font-size">~$ setup-kolab</pre>



<p>It will ask for some information and several passwords. The password for the directory manager will be used to first login, so remember it. Also passwords for a the cyrus-imapd administrator, a kolab-service user, the mysql database root user and several database passwords are needed. Note, that all of them are stored in the /etc/kolab/kolab.conf file and only very few are needed for interactive logins.</p>



<p>Kolab comes without a predefined admin user. Only the directory admin is defined which should not be used for user administration. So we login as &#8220;cn=Directory Manager&#8221; and define a new admin user. In our default setup, the UID is generated from the surname (check the &#8220;System&#8221; tab), so we choose <code>kolab-admin</code> to differentiate from <code>pi-admin</code> and <code>keycloak-admin</code> later.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/03-kolab-webadmin-login-ssl.png" alt="" class="wp-image-1786" width="524" height="361" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/03-kolab-webadmin-login-ssl.png 627w, https://www.privacyidea.org/wp-content/uploads/2020/02/03-kolab-webadmin-login-ssl-300x207.png 300w" sizes="(max-width: 524px) 100vw, 524px" /></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-add-user-1.png" alt="" class="wp-image-1788" width="534" height="513" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-add-user-1.png 534w, https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-add-user-1-300x288.png 300w" sizes="(max-width: 534px) 100vw, 534px" /></figure></div>



<p>On the System tab we set the predefined <code>kolab-admin</code> role for the user to grant him access for user management. Also set a password.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-add-user-2.png" alt="" class="wp-image-1789" width="529" height="390" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-add-user-2.png 529w, https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-add-user-2-300x221.png 300w" sizes="auto, (max-width: 529px) 100vw, 529px" /></figure></div>



<p>Hit submit to complete the process. Next add another ordinary user to test the second factor login later on. We call this user <code>test-user</code>.</p>



<h3 class="wp-block-heading">privacyIDEA 3.x Installation</h3>



<p>Now, we setup privacyIDEA. Install instructions for the most recent version can be found at <a href="https://privacyidea.readthedocs.io/en/latest/">readthedocs.privacyidea.io</a>. We install the <a href="https://privacyidea.readthedocs.io/en/latest/installation/ubuntu.html#installing-privacyidea-3-0-or-higher">official Ubuntu packages</a>, specifically the <code>privacyidea-apache2</code> package. The installation only takes few minutes. After creating the admin user, here called <code>pi-admin</code>, with</p>



<pre class="wp-block-preformatted has-small-font-size">~$ pi-manage admin add pi-admin -e pi-admin@localhost</pre>



<p>we login to the UI. privacyIDEA needs to access the LDAP directory provided by Kolab, so we create an LDAP resolver and use the Kolab service account created above via &#8220;Config-&gt;Users-&gt;New ldapresolver&#8221;. The dn and password for the kolab-service account can be checked in the file /etc/kolab/kolab.conf. We use the OpenLDAP preset given by privacyIDEA but change the UID type to &#8220;dn&#8221;. The resolver test buttons help to avoid typos and to check the connection. For the test, we leave TLS to be configured later.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/ldap-resolver-2-829x1024.png" alt="" class="wp-image-1794" width="829" height="1024" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/ldap-resolver-2-829x1024.png 829w, https://www.privacyidea.org/wp-content/uploads/2020/02/ldap-resolver-2-243x300.png 243w, https://www.privacyidea.org/wp-content/uploads/2020/02/ldap-resolver-2-768x948.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/ldap-resolver-2.png 1149w" sizes="auto, (max-width: 829px) 100vw, 829px" /></figure></div>



<p>The resolver is added to a new realm <code>kolab_realm</code> at &#8220;Config-&gt;Realms-&gt;Create Realm&#8221;.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1019" height="133" src="https://www.privacyidea.org/wp-content/uploads/2020/02/create-realm.png" alt="" class="wp-image-1796" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/create-realm.png 1019w, https://www.privacyidea.org/wp-content/uploads/2020/02/create-realm-300x39.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/create-realm-768x100.png 768w" sizes="auto, (max-width: 1019px) 100vw, 1019px" /></figure></div>



<p></p>



<p>You should now be able to see the users within privacyIDEA.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/users.png" alt="" class="wp-image-1803" width="478" height="274" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/users.png 637w, https://www.privacyidea.org/wp-content/uploads/2020/02/users-300x172.png 300w" sizes="auto, (max-width: 478px) 100vw, 478px" /></figure></div>



<p>We will enroll an HOTP token for <code>test-user</code> with the <a href="https://netknights.it/en/produkte/privacyidea-authenticator-app/">privacyIDEA App</a>, available from Google Play Store. You may alternatively use the Google Authenticator. Install the app and proceed with the enrollment as given below. The privacyIDEA UI auto-completes the username as you type. The generated QR code must be scanned with the App to complete the enrollment.</p>



<figure class="wp-block-gallery columns-3 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/enroll.png"><img loading="lazy" decoding="async" width="851" height="807" src="https://www.privacyidea.org/wp-content/uploads/2020/02/enroll.png" alt="" data-id="1797" class="wp-image-1797" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/enroll.png 851w, https://www.privacyidea.org/wp-content/uploads/2020/02/enroll-300x284.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/enroll-768x728.png 768w" sizes="auto, (max-width: 851px) 100vw, 851px" /></a><figcaption class="blocks-gallery-item__caption">Enroll a new OTP token&#8230;</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/enroll2-1-1024x376.png"><img loading="lazy" decoding="async" width="1024" height="376" src="https://www.privacyidea.org/wp-content/uploads/2020/02/enroll2-1-1024x376.png" alt="" data-id="1859" data-link="https://www.privacyidea.org/?attachment_id=1859" class="wp-image-1859" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/enroll2-1-1024x376.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/02/enroll2-1-300x110.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/enroll2-1-768x282.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/enroll2-1.png 1119w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="blocks-gallery-item__caption">&#8230;with the privacyIDEA app.</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/token-1.jpg"><img loading="lazy" decoding="async" width="870" height="1024" src="https://www.privacyidea.org/wp-content/uploads/2020/02/token-1-870x1024.jpg" alt="" data-id="1860" data-full-url="https://www.privacyidea.org/wp-content/uploads/2020/02/token-1.jpg" data-link="https://www.privacyidea.org/?attachment_id=1860" class="wp-image-1860" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/token-1-870x1024.jpg 870w, https://www.privacyidea.org/wp-content/uploads/2020/02/token-1-255x300.jpg 255w, https://www.privacyidea.org/wp-content/uploads/2020/02/token-1-768x904.jpg 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/token-1.jpg 872w" sizes="auto, (max-width: 870px) 100vw, 870px" /></a><figcaption class="blocks-gallery-item__caption">The token is assigned to &#8220;test-user&#8221;.</figcaption></figure></li></ul></figure>



<p>The OTP token is now assigned to the user <code>test-user</code> and the privacyIDEA app on your phone should display a six-digits OTP code.</p>



<p>To issue trigger challenges asking for an OTP key on user login, privacyIDEA needs an authorization. Since we do not want our pi-admin password to flow through the wire all the time, we create another, unpriviledged admin user on the privacyIDEA terminal.</p>



<pre class="wp-block-preformatted has-small-font-size">~$ pi-manage admin add trigger-admin -e trigger-admin@localhost</pre>



<p>The trigger-admin needs a superuser policy to restrict the access. In &#8220;Config-&gt;Policies&#8221;, first create a default superuser policy using the &#8220;superuser&#8221; template. Add only the pi-admin to the <code>admin</code> field. Then add another policy without template. Name it <code>trigger_admin</code>, select the scope <code>admin</code>, add the action <code>triggerchallenge</code> and add the created trigger-admin to the <code>admin</code> field. Now, we have two admin users. pi-admin has the default superuser access and trigger-admin has only very limited access allowing to trigger the challenge.</p>



<p>As privacyIDEA is now up and running, we proceed with the Keycloak server, which will act as the central element in the SSO environment.</p>



<h3 class="wp-block-heading">Keycloak 9 Installation</h3>



<p>Start the Keycloak installation by downloading the Keycloak standalone server from <a href="https://www.keycloak.org/downloads.html">keycloak.org</a>. General install information is found in the <a href="https://www.keycloak.org/docs/latest/getting_started/">&#8220;getting started&#8221; guide</a>. A detailed guide how to integrate Keycloak with systemd on Ubuntu Server 18.04 LTS is found <a href="https:&#x2f;/&#x6d;&#101;&#x64;&#105;&#x75;&#x6d;&#46;&#x63;&#111;&#x6d;&#47;&#x40;&#104;a&#x73;&#110;&#x61;&#116;&#x2e;&#115;a&#x65;&#101;&#x64;/setup-keycloak-server-on-ubuntu-18-04-ed8c7c79a2d9">here</a>. The necessary steps are summarized below.</p>



<pre class="wp-block-preformatted has-small-font-size">~$ sudo apt-get update
~$ sudo apt-get install default-jre-headless
# Install Keycloak 9
~$ mkdir -p /opt/keycloak /etc/keycloak
~$ wget https://downloads.jboss.org/keycloak/9.0.0/keycloak-9.0.0.tar.gz
~$ tar -xvzf keycloak-9.0.0.tar.gz
~$ mv keycloak-9.0.0.tar.gz /opt/keycloak
# Add keycloak user
~$ groupadd keycloak
~$ useradd -r -g keycloak -d /opt/keycloak -s /sbin/nologin keycloak
~$ chown -R keycloak: /opt/keycloak
~$ chmod o+x /opt/keycloak/bin/
# Place config file
~$ cp /opt/keycloak/docs/contrib/scripts/systemd/wildfly.conf /etc/keycloak/keycloak.conf
# Setup systemd files
~$ sed 's/wildfly/keycloak/' /opt/keycloak/docs/contrib/scripts/systemd/launch.sh \
| tee /opt/keycloak/bin/launch.sh
~$ chown keycloak: /opt/keycloak/bin/launch.sh
~$ sed 's/wildfly/keycloak/g' /opt/keycloak/docs/contrib/scripts/systemd/wildfly.service \
| tee /etc/systemd/system/keycloak.service
# Enable and start the daemon
~$ systemctl daemon-reload
~$ systemctl enable keycloak
~$ systemctl start keycloak
~$ systemctl status keycloak
# Add admin user
~$ /opt/keycloak/bin/add-user-keycloak.sh -r master -u <strong>keycloak-admin</strong> -p <strong>&lt;password&gt;</strong> 
~$ systemctl restart keycloak</pre>



<p>Now you should be greeted by Keycloak at http://192.168.56.202:8080. Login with your created <code>keycloak-admin</code> user. As Keycloak should validate the user logins it has to have access to the user store. In &#8220;User Federation&#8221;, add an LDAP provider with the following settings. The kolab-service account is used as an unpriviledged bind and again we disable TLS for the test setup.</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-ldap-setup-2.png" alt="" class="wp-image-1824" width="874" height="1625" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-ldap-setup-2.png 1089w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-ldap-setup-2-161x300.png 161w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-ldap-setup-2-551x1024.png 551w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-ldap-setup-2-768x1428.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-ldap-setup-2-826x1536.png 826w" sizes="auto, (max-width: 874px) 100vw, 874px" /></figure></div>



<p>Hit &#8220;Synchronize all users&#8221; to pull the users from LDAP to Keycloak. You may enable the periodic sync to keep the Keycloak user store up-to-date.</p>



<p><strong>Important: </strong>The keycloak-admin should not be required to provide a second factor to prevent locking the configuration while testing. For this purpose, define a <code>no2fa</code> group in &#8220;Groups&#8221; and add the keycloak-admin to that group in &#8220;Users&#8221;.</p>



<p>Next, privacyIDEA is integrated with Keycloak. Following our earlier article on the integration of <a href="https://community.privacyidea.org/t/how-to-use-keycloak-with-privacyidea/1132">Django with Keycloak and privacyIDEA</a>, we download the two files <a href="https://github.com/privacyidea/keycloak-provider/releases/download/v0.3/PrivacyIDEA-Provider.jar">PrivacyIDEA-Provider.jar</a> and <a href="https://github.com/privacyidea/keycloak-provider/releases/download/v0.3/privacyIDEA.ftl">privacyIDEA.ftl</a> of the most recent release of the <a href="https://github.com/privacyidea/keycloak-provider">privacyIDEA keycloak-provider</a> and install it to Keycloak.</p>



<pre class="wp-block-preformatted has-small-font-size">~$ wget https://github.com/privacyidea/keycloak-provider/releases/download/v0.3/PrivacyIDEA-Provider.jar
~$ wget https://github.com/privacyidea/keycloak-provider/releases/download/v0.3/privacyIDEA.ftl
~$ cp PrivacyIDEA-Provider.jar /opt/keycloak/standalone/deployment/
~$ cp privacyIDEA.ftl /opt/keycloak/themes/base/login/</pre>



<p>In Keycloak, the authentication is managed in so called &#8220;Authentication Flows&#8221;. Copy the default browser-based flow below and rename it to PrivacyIDEA.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-browser-1024x341.png" alt="" class="wp-image-1808" width="768" height="256" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-browser-1024x341.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-browser-300x100.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-browser-768x255.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-browser.png 1362w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure>



<p>Add an execution to &#8220;PrivacyIDEA Forms&#8221; and choose the installed plugin called PrivacyIDEA from the list.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution-button.png" alt="" class="wp-image-1810" width="760" height="96" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution-button.png 1013w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution-button-300x38.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution-button-768x97.png 768w" sizes="auto, (max-width: 760px) 100vw, 760px" /></figure>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution.png" alt="" class="wp-image-1809" width="516" height="142" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution.png 688w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-flow-add-execution-300x82.png 300w" sizes="auto, (max-width: 516px) 100vw, 516px" /></figure>



<p>Delete the unnecessary items in the flow (or set them to disabled), so that only &#8220;PrivacyIDEA Forms&#8221; and &#8220;Cookie&#8221; remain. The authentication flow should now look like this:</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-final-1024x280.png" alt="" class="wp-image-1813" width="768" height="210" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-final-1024x280.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-final-300x82.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-final-768x210.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-final.png 1132w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure>



<p>We set PrivacyIDEA to REQUIRED here, which means that additionally to username and password, the second factor is required for all users. We have to configure the plugin to reach our privacyIDEA server at https://192.168.56.202. We disable SSL-verification for the self-signed certificate here, which you must not do in a productive environment. Members of the <code>no2fa</code> group, defined above will not be asked for their second factor. For issuing the trigger challenge a service account is needed. We use the <code>trigger-admin</code> account created in privacyIDEA earlier.<br></p>



<figure class="wp-block-image size-large is-resized is-style-default"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-config-button.png" alt="" class="wp-image-1812" width="603" height="74" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-config-button.png 804w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-config-button-300x37.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-authentication-privacyidea-config-button-768x94.png 768w" sizes="auto, (max-width: 603px) 100vw, 603px" /></figure>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-privacyidea-settings3.png" alt="" class="wp-image-1829" width="617" height="497" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-privacyidea-settings3.png 822w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-privacyidea-settings3-300x242.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-privacyidea-settings3-768x619.png 768w" sizes="auto, (max-width: 617px) 100vw, 617px" /></figure>



<p>Set the edited authentication flow as default browser flow in &#8220;Bindings&#8221;.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/binding.png" alt="" class="wp-image-1821" width="608" height="283" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/binding.png 811w, https://www.privacyidea.org/wp-content/uploads/2020/02/binding-300x139.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/binding-768x357.png 768w" sizes="auto, (max-width: 608px) 100vw, 608px" /></figure>



<p>So privacyIDEA is now configured to challenge the second factor for every user. The last step is to enable OpenID Connect logins in roundcubemail.</p>



<h3 class="wp-block-heading">Installation of the Kolab SSO plugin</h3>



<p>For the OIDC, Kolab provides the <code>kolab_sso</code> plugin for Roundcubemail which is available on git.kolab.org. Clone the repository and copy the plugin to the Roundcubemail directory to install it.</p>



<pre class="wp-block-preformatted has-small-font-size">~$ git clone https://git.kolab.org/diffusion/RPK/roundcubemail-plugins-kolab.git
~$ cp -r roundcubemail-plugins-kolab/plugins/kolab_sso/ /usr/share/roundcubemail/plugins/</pre>



<p>Place the default configuration file.</p>



<pre class="wp-block-preformatted has-small-font-size">~$ cp /usr/share/roundcubemail/plugins/kolab_sso/config.inc.php.dist /etc/roundcubemail/kolab_sso.inc.php</pre>



<p>Apache should redirect <code>host.roundcube/sso</code> to <code>host.roundcube/?_task=login&amp;_action=sso</code>, since keycloak does not support parameters in urls. It will display &#8220;Invalid parameter: redirect_uri&#8221;. Add the redirect as follows to /etc/apache2/sites-enabled/roundcubemail.conf.</p>



<pre class="wp-block-preformatted has-small-font-size">RewriteEngine On
RewriteCond %{REQUEST_URI} ^/roundcubemail
RewriteRule "^sso" "/roundcubemail/?_task=login&amp;_action=sso" [L,QSA]</pre>



<p>We proceed on the Keycloak machine and add Roundcubemail as a new OpenID Connect client as given below.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="834" height="1024" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-settings-834x1024.png" alt="" class="wp-image-1817" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-settings-834x1024.png 834w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-settings-244x300.png 244w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-settings-768x943.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-settings.png 1100w" sizes="auto, (max-width: 834px) 100vw, 834px" /></figure>



<p>Save the form to access the &#8220;Credentials&#8221; tab. We will soon need the generated secret again.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-credentials.png" alt="" class="wp-image-1818" width="804" height="187" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-credentials.png 804w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-credentials-300x70.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-roundcubemail-client-credentials-768x179.png 768w" sizes="auto, (max-width: 804px) 100vw, 804px" /></figure>



<p>The kolab_sso plugin needs the certificate of the Keycloak server during the OpenID Connect authentication process. It is available from the Keycloak management console in the &#8220;Realm Settings&#8221;.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="253" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-realm-certificate2-1024x253.png" alt="" class="wp-image-1831" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-realm-certificate2-1024x253.png 1024w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-realm-certificate2-300x74.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-realm-certificate2-768x190.png 768w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-realm-certificate2.png 1176w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Add the key and the client secret alongside the <code>token_uri</code> and <code>auth_uri</code> to the <code>kolab_sso.inc.php</code> configuration file. Make sure that the public key copied from keycloak is properly formatted. The IMAP, SMTP and LDAP credentials in the top part of the file are required for accessing the mailbox, sending emails and accessing the server addressbooks. Configure them accordingly.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="915" height="679" src="https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-kolab_sso-plugin-config-keycloak.png" alt="" class="wp-image-1807" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-kolab_sso-plugin-config-keycloak.png 915w, https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-kolab_sso-plugin-config-keycloak-300x223.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/kolab-kolab_sso-plugin-config-keycloak-768x570.png 768w" sizes="auto, (max-width: 915px) 100vw, 915px" /></figure></div>



<p>After successfully testing the ordinary password login with Roundcubemail at http://192.168.56.200/roundcubemail, you may disable the password login to allow only OpenID Connect by setting</p>



<pre class="wp-block-preformatted has-small-font-size"> $config['kolab_sso_disable_login'] = true;</pre>



<p>in <code>kolab_sso.inc.php</code>.</p>



<h3 class="wp-block-heading">Test the login</h3>



<p>We are now ready to test the OpenID Connect  login at Roundcubemail. Navigate once again to http://192.168.56.200/roundcubemail to test the login. You may monitor some log files during the process.</p>



<pre class="wp-block-preformatted has-small-font-size">/var/log/privacyidea/privacyidea.log
/var/log/roundcubemail/*
/opt/keycloak/standalone/log/*</pre>



<figure class="wp-block-gallery alignwide columns-4 is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login.png"><img loading="lazy" decoding="async" width="453" height="287" src="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login.png" alt="" data-id="1840" data-link="https://www.privacyidea.org/?attachment_id=1840" class="wp-image-1840" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login.png 453w, https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login-300x190.png 300w" sizes="auto, (max-width: 453px) 100vw, 453px" /></a><figcaption class="blocks-gallery-item__caption">The Roundcubemail kolab_sso login&#8230;</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login.png"><img loading="lazy" decoding="async" width="577" height="514" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login.png" alt="" data-id="1836" data-link="https://www.privacyidea.org/?attachment_id=1836" class="wp-image-1836" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login.png 577w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login-300x267.png 300w" sizes="auto, (max-width: 577px) 100vw, 577px" /></a><figcaption class="blocks-gallery-item__caption">gets redirected to Keycloak.</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login_2FA.png"><img loading="lazy" decoding="async" width="525" height="305" src="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login_2FA.png" alt="" data-id="1837" data-link="https://www.privacyidea.org/?attachment_id=1837" class="wp-image-1837" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login_2FA.png 525w, https://www.privacyidea.org/wp-content/uploads/2020/02/keycloak-oidc_login_2FA-300x174.png 300w" sizes="auto, (max-width: 525px) 100vw, 525px" /></a><figcaption class="blocks-gallery-item__caption">After typing the password, the user is prompted to provide a second factor&#8230;</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/privacyIDEA_Authenticator.png"><img loading="lazy" decoding="async" width="540" height="327" src="https://www.privacyidea.org/wp-content/uploads/2020/02/privacyIDEA_Authenticator.png" alt="" data-id="1838" data-link="https://www.privacyidea.org/?attachment_id=1838" class="wp-image-1838" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/privacyIDEA_Authenticator.png 540w, https://www.privacyidea.org/wp-content/uploads/2020/02/privacyIDEA_Authenticator-300x182.png 300w" sizes="auto, (max-width: 540px) 100vw, 540px" /></a><figcaption class="blocks-gallery-item__caption">&#8230;which we get in this case from the OTP token in the privacyIDEA app.</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login_mailbox-1.png"><img loading="lazy" decoding="async" width="902" height="460" src="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login_mailbox-1.png" alt="" data-id="1842" data-full-url="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login_mailbox-1.png" data-link="https://www.privacyidea.org/?attachment_id=1842" class="wp-image-1842" srcset="https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login_mailbox-1.png 902w, https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login_mailbox-1-300x153.png 300w, https://www.privacyidea.org/wp-content/uploads/2020/02/roundcubemail-login_mailbox-1-768x392.png 768w" sizes="auto, (max-width: 902px) 100vw, 902px" /></a><figcaption class="blocks-gallery-item__caption">The correct OTP gets us directly to Roundcubemail webmail.</figcaption></figure></li></ul></figure>



<h3 class="wp-block-heading">Conclusion</h3>



<p>We demonstrated the integration of privacyIDEA with Keycloak to provide a solid basis to secure your applications with a second factor in a single sign-on (SSO) environment. For maximum flexibility, the system relies on standard protocols such as SAML or OpenID Connect (OIDC). The privacyIDEA keycloak-provider is designed to perfectly fit the two components together, uniting the rich identity management capabilities of Keycloak and the powerful multi factor management of privacyIDEA.</p>



<p>We chose the Roundcubemail webmailer of the Kolab Collaboration Server as an example application. The kolab_sso plugin provided the necessary interface to connect via OIDC to easily enhance security by adding a second factor managed by privacyIDEA. The setup of other popular open collaboration platforms such as <a href="https://www.tine20.com/en/">Tine 2.0</a> or <a href="https://www.open-xchange.com/">Open-Xchange</a> work similarly.</p>



<p>Including additional applications in this setup is very easy as long as they support at least one SSO protocol. These applications do not even to be hosted on your own servers. Nowadays, most cloud-based applications offer both, the possibility to use an external identity provider and to use OIDC. Thus, you can also use remote services with your own user base, defining access-rules to fit your needs.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/versatile-2fa-single-sign-on-with-keycloak-and-privacyidea/feed/</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
			</item>
		<item>
		<title>SSH Keys and OTP: Really strong two factor authentication</title>
		<link>https://www.privacyidea.org/ssh-keys-and-otp-really-strong-two-factor-authentication/</link>
					<comments>https://www.privacyidea.org/ssh-keys-and-otp-really-strong-two-factor-authentication/#comments</comments>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Thu, 29 Oct 2015 11:00:29 +0000</pubDate>
				<category><![CDATA[documentation]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[Yubikey]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=771</guid>

					<description><![CDATA[This blog will show how you can use privacyIDEA to secure your SSH login. In this case users need to provide an SSH Key and in addition an OTP token and an optional password. Thus you have the following authentication factors: SSH Key (soft possession factor &#8211; copyable!) optional passphrase on the SSH Key, which is [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This blog will show how you can use privacyIDEA to secure your SSH login. In this case users need to provide an SSH Key and in addition an OTP token and an optional password.</p>
<p>Thus you have the following authentication factors:</p>
<ol>
<li>SSH Key (soft <strong>possession</strong> factor &#8211; copyable!)</li>
<li>optional passphrase on the SSH Key, which is not controlled by the server! (<strong>knowledge</strong>)</li>
<li>OTP token <a href="http://privacyidea.readthedocs.org/en/latest/configuration/token_config.html#supported-tokentypes" target="_blank">supported by privacyIDEA</a> like Google Authenticator or preferable a Yubikey (hard <strong>possession</strong> factor &#8211; not copyable)</li>
<li>an optional OTP PIN controlled by privacyIDEA (<strong>knowledge</strong>)</li>
</ol>
<h2>Connect SSH to privacyIDEA</h2>
<p>Connecting SSH to privacyIDEA is described in this <a href="https://www.youtube.com/watch?v=tNoHzrajtcg&amp;t=1m52s" target="_blank">video</a>. It uses the privacyIDEA PAM Module in the <a href="http://privacyidea.readthedocs.org/en/latest/application_plugins/index.html#pluggable-authentication-module">online documentation</a>.</p>
<p>In the SSH configuration you need to set</p>
<pre>UsePAM yes</pre>
<p>This way SSH will authenticate the user against the PAM stack using <em>/etc/pam.d/sshd</em>.</p>
<p>This howto will assume you are using a Ubuntu system. Other systems like CentOS use slightly different PAM configuration, but the idea is the same.</p>
<h3>Install privacyIDEA PAM</h3>
<p>To use PAM with privacyIDEA you need the privacyIDEA <a href="https://github.com/privacyidea/pam_python">PAM authentication module</a>. On a Ubuntu 14.04 you can install it like</p>
<pre>add-apt-repository ppa:privacyidea/privacyidea
apt-get update
apt-get install privacyidea-pam</pre>
<p>In other cases you can get it from github with the above mentioned link.</p>
<h3>Configure SSH PAM</h3>
<p>Now lets take a look at the PAM config for SSH. The file <em>/etc/pam.d/sshd</em> contains a line</p>
<pre>@include common-auth</pre>
<p>Change this line to</p>
<pre>@include common-auth-pi</pre>
<p>By creating such a new file it is easier for us to add two factors to every PAM enabled service.</p>
<p>Copy the file <em>/etc/pam.d/common-auth</em> to <em>/etc/pam.d/common-auth-pi</em>. The file<em> /etc/pam.d/common-auth-pi</em> will look like this:</p>
<pre>auth     [success=1 default=ignore] pam_python.so /lib/security/privacyidea_pam.py url=https://yourserver \ 
                                                  nosslverify debug
auth    requisite   pam_deny.so
auth    required    pam_permit.so
auth    optional    pam_cap.so</pre>
<p>In the file <em>common-auth-pi</em> we replace <em>pam_unix.so</em> with <em>privacyidea_pam</em>. You need to specify the URL of your privacyIDEA server. If everything is working out fine, you can remove the <em>debug</em> parameter. If you have a trusted certificate you can remove <em>nosslverify</em>.</p>
<blockquote><p>Please assure, that you are logged in to your system or that you have other mean to login like ssh keys. Modifying the PAM stack for SSH can result in not being able to login with a password via SSH anymore.</p></blockquote>
<p>Now that you have configured</p>
<ul>
<li>/etc/ssh/sshd_config</li>
<li>/etc/pam.d/common-auth-pi</li>
<li>/etc/pam.d/sshd</li>
</ul>
<p>you can restart the SSH server for the changes to take effect.</p>
<p>When you now try to login via SSH, the username and password will be sent to privacyIDEA for verification. You can not use you OTP PIN and Yubikey to login.</p>
<blockquote><p>If you experience any problems, take a look at <em>/var/log/auth.log</em>.</p></blockquote>
<p>If everything is working fine, you are now authenticating with:</p>
<ol>
<li>OTP token <a href="http://privacyidea.readthedocs.org/en/latest/configuration/token_config.html#supported-tokentypes" target="_blank">supported by privacyIDEA</a> like Google Authenticator or preferable a Yubikey (hard <strong>possession</strong> factor &#8211; not copyable)</li>
<li>an optional OTP PIN controlled by privacyIDEA (<strong>knowledge</strong>)</li>
</ol>
<h2>Add SSH Keys</h2>
<p>You may realize, that if you have an SSH key in the authorized_keys you will not be asked for the OTP. At the moment you either login with SSH key or with OTP. Let&#8217;s change this now, that you can use SSH key <strong>and</strong> OTP.</p>
<p>The current OpenSSH comes with the options <strong>AuthenticationMethods</strong>. This is used to concatenate required authentication methods. See the man page of sshd_config for more details.</p>
<p>In the file<em> /etc/ssh/sshd_config</em> we add this line:</p>
<pre>AuthenticationMethods publickey,password</pre>
<p>This means that SSH will require that you pass a trusted SSH key and after this ask you for a password (PIN+OTP), which will be verified by privacyIDEA.</p>
<p>The login will look like this:</p>
<pre>root@gawain ~ # ssh root@privacyidea
Authenticated with partial success.
root@privacyidea's password: 
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-66-generic x86_64)</pre>
<p>The &#8220;Authenticated with partial success&#8221; means, that the authentication with the SSH key succeeded. Now you need to specify the One Time Password to be sent to privacyIDEA.</p>
<blockquote><p>Note: If you want to login as user &#8220;root&#8221;, be sure to add &#8220;PermitRootLogin yes&#8221; to your<em> sshd_config</em>.</p></blockquote>
<p>Finally we managed to authenticate the users with:</p>
<ol>
<li>SSH Key (soft <strong>possession</strong> factor &#8211; copyable!)</li>
<li>optional passphrase on the SSH Key, which is not controlled by the server! (<strong>knowledge</strong>)</li>
<li>OTP token <a href="http://privacyidea.readthedocs.org/en/latest/configuration/token_config.html#supported-tokentypes" target="_blank">supported by privacyIDEA</a> like Google Authenticator or preferable a Yubikey (hard <strong>possession</strong> factor &#8211; not copyable)</li>
<li>an optional OTP PIN controlled by privacyIDEA (<strong>knowledge</strong>)</li>
</ol>
<h2>Manage SSH Keys with privacyIDEA</h2>
<p>Wait! Are you still there? One thing might still strike you:</p>
<p>While all OTP tokens are centrally managed by privacyIDEA, users still put their public SSH keys on all the machines and you are wondering where the SSH keys of all the users are floating around.</p>
<p>There is no easy way for you to revoke a compromized SSH key.</p>
<p>But you can also solve this with privacyIDEA. Users can upload their public SSH keys to privacyIDEA with the tokentype <a href="http://privacyidea.readthedocs.org/en/latest/configuration/tokens/sshkey.html" target="_blank">SSH Key</a>.</p>
<p>This way you can also manage all SSH keys in privacyIDEA. In sshd_config you need to use the AuthorizedKeysCommand to retrieve the SSH keys from privayyIDEA just in time. Deleting an SSH key in privacyIDEA will deny access for this user immediatly.</p>
<p>You can read <a href="https://www.howtoforge.com/tutorial/ssh-key-management-with-privacyidea/" target="_blank">SSH Key Management with privacyIDEA</a> to set this up.</p>
<p>This way you have three strong factors to secure the access to SSH.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/ssh-keys-and-otp-really-strong-two-factor-authentication/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>OTP Workshop at TÜBIX</title>
		<link>https://www.privacyidea.org/otp-workshop-at-tubix/</link>
					<comments>https://www.privacyidea.org/otp-workshop-at-tubix/#respond</comments>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Sat, 23 May 2015 06:47:54 +0000</pubDate>
				<category><![CDATA[events]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Yubikey]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=603</guid>

					<description><![CDATA[In Tübingen, Germany will be a new Linuxtag &#8211; called Tübix. It is the first time that this event is conducted. The location and the program seems to be very interesting. Cornelius will do a workshop there about installing privacyIDEA, enrolling tokens and authenticating at SSH. You should get an IDEA how easy it is [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In Tübingen, Germany will be a new Linuxtag &#8211; called <a href="http://tuebix.org" target="_blank">Tübix</a>. It is the first time that this event is conducted. The location and the program seems to be very interesting.</p>
<p>Cornelius will do a <a href="http://www.tuebix.org/programm/koelbel-privacyidea/" target="_blank">workshop</a> there about installing privacyIDEA, enrolling tokens and authenticating at SSH. You should get an IDEA how easy it is to protect your private data and authenticate with two factors. Especially with a second factor that is totally under your control and not issued to you by any need-to-trust-me &#8220;authority&#8221; or &#8220;vendor&#8221;.</p>
<p>Therefor each attendee will get his own Yubikey, which he can initialized so that the cryptographic key material is only know to YOU. And you only.</p>
<p>You can also hear a <a href="http://www.tuebix.org/programm/koelbel-desktop_auth/" target="_blank">lightning talk</a> about the concept of locking your desktop with your smartphone but with an additional challenge response mechanism, which is more trustworthy then just a simple bluetooth coupling.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/otp-workshop-at-tubix/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>privacyIDEA on Ubuntu 14.04LTS</title>
		<link>https://www.privacyidea.org/privacyidea-on-ubuntu-14-04lts/</link>
					<comments>https://www.privacyidea.org/privacyidea-on-ubuntu-14-04lts/#respond</comments>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Mon, 02 Mar 2015 08:20:50 +0000</pubDate>
				<category><![CDATA[documentation]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Videos]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=534</guid>

					<description><![CDATA[Installing privacyIDEA on Ubuntu 14.04LTS is easy as pie. Watch this video on YouTube. In short this is: add-apt-repository ppa:privacyidea/privacyidea apt-get update apt-get install privacyidea-apache2 You can also take a look at the online documentation.]]></description>
										<content:encoded><![CDATA[<p>Installing privacyIDEA on Ubuntu 14.04LTS is easy as pie.</p>
<p><a href="https://www.privacyidea.org/privacyidea-on-ubuntu-14-04lts/"><img decoding="async" src="https://www.privacyidea.org/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FYzQPA3fQuYQ%2Fhqdefault.jpg" alt="YouTube Video"></a><br /> <a href="https://youtu.be/YzQPA3fQuYQ" target="_blank">Watch this video on YouTube</a>.</p>
<p>In short this is:</p>
<div class="highlight-python">
<pre class="highlight">add-apt-repository ppa:privacyidea/privacyidea</pre>
<pre class="highlight">apt-get update</pre>
<pre class="highlight">apt-get install privacyidea-apache2
</pre>
</div>
<p>You can also take a look at the <a href="http://privacyidea.readthedocs.org/en/latest/installation/index.html#ubuntu-packages" target="_blank">online documentation</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/privacyidea-on-ubuntu-14-04lts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>privacyIDEA 2.0 released</title>
		<link>https://www.privacyidea.org/privacyidea-2-0-released/</link>
					<comments>https://www.privacyidea.org/privacyidea-2-0-released/#respond</comments>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Sat, 21 Feb 2015 13:25:06 +0000</pubDate>
				<category><![CDATA[release]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Whatsup]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=519</guid>

					<description><![CDATA[Today we released privacyIDEA 2.0. privacyIDEA 2.0 is a migration and rewrite to Flask and AngularJS. The old privacyIDEA was based on the pylons web framework, which was not actively maintained for a while anymore, which also lead to some version conflicts. Using Flask now makes privacyIDEA a lightweight installation with a cleaner design. AngularJS [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Today we released privacyIDEA 2.0.</p>
<p>privacyIDEA 2.0 is a migration and rewrite to Flask and AngularJS.</p>
<p>The old privacyIDEA was based on the pylons web framework, which was not actively maintained for a while anymore, which also lead to some version conflicts. Using Flask now makes privacyIDEA a lightweight installation with a cleaner design. AngularJS is used for the WebUI which is implemented as a single page application. The two way data binding of AngularJS provides a rapid development on the UI side.</p>
<p>The internal code structure is hopefully kept clean. As an example there are unit tests for all levels of the code, which run on their own. The policies which were woven into the code very deeply in version 1.5 are now implemented using decorators. Thus the original functions stay clean from policies and the policies just wrap the original functionality but leave the code untouched.</p>
<p>The Changelog looks like this:</p>
<ul>
<li>Migrate privacyIDEA to Flask Web framework</li>
<li>The WebUI was migrated to bootstrap and angularJS</li>
<li>The database model was restructered to allow an easier handling and programming</li>
<li>Use the pi-manage.py tool to migrate old data</li>
<li>Provide ubuntu packages for privacyidea base package and privacyidea-apache2 and privacyidea-nginx</li>
<li>Provide pi-manage.py tool to manage the installation and create new admins.</li>
<li>Policies are restructured. Internally the policies now use decorators to have a minimum code impact. No all policies are migrated, yet.</li>
<li>OCRA token and Email token is not migrated, yet.</li>
</ul>
<p>privacyIDEA is available at the <a href="https://pypi.python.org/pypi/privacyIDEA/2.0" target="_blank">python package index</a> and as <a href="https://launchpad.net/~privacyidea/+archive/ubuntu/privacyidea" target="_blank">ready made packages for Ubuntu 14.04LTS.</a> The way to install these is described in the <a href="http://privacyidea.readthedocs.org/en/latest/installation/index.html" target="_blank">online documentation</a>.</p>
<p>Take a glimpse at privacyIDEA 2.0 in this <a href="https://www.youtube.com/watch?v=Cwzz5PCjHQI" target="_blank">video</a> or see the <a title="Demo site" href="https://www.privacyidea.org/about/demo-site/">demo site</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/privacyidea-2-0-released/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to install privacyIDEA OTP server on Ubuntu 14.04</title>
		<link>https://www.privacyidea.org/how-to-install-privacyidea-otp-server-on-ubuntu-14-04/</link>
					<comments>https://www.privacyidea.org/how-to-install-privacyidea-otp-server-on-ubuntu-14-04/#comments</comments>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Wed, 16 Jul 2014 09:55:53 +0000</pubDate>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Benchmark]]></category>
		<category><![CDATA[Performance]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=303</guid>

					<description><![CDATA[Please note: This howto is outdated. It refers to a rather old version of privacyIDEA. Please read the install documentation at readthedocs. Starting with privacyIDEA 1.2 a debian package for Ubuntu 14.04 is availble. Please note, that you will not be able to install it on 12.04, since there would be missing requirements. privacyIDEA depends [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong><span style="color: #ff0000;">Please note: This howto is outdated. It refers to a rather old version of privacyIDEA. Please read the install <a style="color: #ff0000;" href="https://privacyidea.readthedocs.org/en/latest/installation/index.html" target="_blank">documentation at readthedocs</a>.</span></strong></p>
<p>Starting with privacyIDEA 1.2 a debian package for Ubuntu 14.04 is availble.</p>
<p>Please note, that you will not be able to install it on 12.04, since there would be missing requirements. privacyIDEA depends on the following packages:</p>
<pre> python-setuptools python-pylons python-qrcode python-netaddr python-ldap python-pyrad python-yaml python-configobj python-repoze.who python-httplib2 python-crypto python-docutils python-repoze.who-plugins</pre>
<p>There are two PPA repositories available on launchpad: <a href="https://launchpad.net/~privacyidea/+archive/ubuntu/privacyidea-dev" target="_blank">privacyidea/privacyidea-dev</a> and <a href="https://launchpad.net/~privacyidea/+archive/ubuntu/privacyidea" target="_blank">privacyidea/privacyidea</a>. The -dev repository is for development releases and testing. The privacyidea/privacyidea repo should contain stable releases.</p>
<h2>Add the repository to your system and install privacyIDEA</h2>
<p>To add the repository to your system run the following command:</p>
<pre>add-apt-repository ppa:privacyidea/privacyidea</pre>
<p>Fetch information on new content:</p>
<pre>apt-get update</pre>
<p>Install it:</p>
<pre>apt-get install privacyidea</pre>
<p>The package creates an SQLite database at /var/lib/privacyidea/token.sqlite. Of course you can use any other database backend. But using sqlite gets you up and running quickly.</p>
<p>Moreover the package contains a start-script /etc/init.d/privacyidea, that is running privacyidea in python-paster, a simple, lightweight webserver.</p>
<p>To start privacyidea run:</p>
<pre>service privacyidea start</pre>
<p>privacyIDEA is now listening on port 5001.</p>
<h2>Create your admin account</h2>
<p>Finally you need to create a first admin account to log in to the management interface:</p>
<pre>privacyidea-create-pwidresolver-user -u admin -p test -i 1000 &gt;&gt; <a class="file" title="/etc/privacyidea/admin-users">/etc/privacyidea/admin-users</a></pre>
<p>Instead of using the weak password test, you should make up a cooler one.</p>
<p>Now you can login at https://yourserver:5001/ with the username &#8220;admin@admin&#8221; and the password you created.</p>
<h2>Some performance data</h2>
<p><a href="https://www.privacyidea.org/wp-content/uploads/2014/07/users-screenshot.png"><img loading="lazy" decoding="async" class="alignleft wp-image-305 size-medium" src="https://www.privacyidea.org/wp-content/uploads/2014/07/users-screenshot-300x184.png" alt="users-screenshot" width="300" height="184" srcset="https://www.privacyidea.org/wp-content/uploads/2014/07/users-screenshot-300x184.png 300w, https://www.privacyidea.org/wp-content/uploads/2014/07/users-screenshot.png 939w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>&nbsp;</p>
<p>The paster is a small webserver. The SQLite is not a state-of-the-art database.</p>
<p>So I always would recommend running privacyIDEA with Apache. This is describe in <a title="Howto run privacyIDEA with Apache2 and MySQL" href="https://www.privacyidea.org/documentation/howtos/howto-run-privacyidea-with-apache2-and-mysql/">this post</a>.</p>
<p>I was wondering what this paster and sqlite could do, So I created a realm containing the local users from /etc/passwd and assigned a simple pass token to one of these users.</p>
<p>&nbsp;</p>
<p>Now I was able to issue an authentication request by calling the API like this:</p>
<p><a href="https://www.privacyidea.org/wp-content/uploads/2014/07/token-screenshot.png"><img loading="lazy" decoding="async" class="alignleft wp-image-306 size-medium" src="https://www.privacyidea.org/wp-content/uploads/2014/07/token-screenshot-300x90.png" alt="token-screenshot" width="300" height="90" srcset="https://www.privacyidea.org/wp-content/uploads/2014/07/token-screenshot-300x90.png 300w, https://www.privacyidea.org/wp-content/uploads/2014/07/token-screenshot.png 741w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre> https://myserver:5001/validate/check?user=man&amp;pass=test</pre>
<p>Now I used ApacheBench to call this URL:</p>
<p>&nbsp;</p>
<pre>% ab -n 1000 -c 10 -s 5 https://172.16.200.139:5001/validate/check?user=man\&amp;pass=test
This is ApacheBench, Version 2.3 &lt;$Revision: 1528965 $&gt;
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 172.16.200.139 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        PasteWSGIServer/0.5
Server Hostname:        172.16.200.139
Server Port:            5001
SSL/TLS Protocol:       TLSv1.2,AES256-GCM-SHA384,2048,256

Document Path:          /validate/check?user=man&amp;pass=test
Document Length:        135 bytes

Concurrency Level:      10
Time taken for tests:   41.964 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      373000 bytes
HTML transferred:       135000 bytes
Requests per second:    23.83 [#/sec] (mean)
Time per request:       419.643 [ms] (mean)
Time per request:       41.964 [ms] (mean, across all concurrent requests)
Transfer rate:          8.68 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        2   11  14.4      9     218
Processing:   121  407 270.7    332    3340
Waiting:      120  406 270.8    332    3340
Total:        126  418 272.0    342    3350

Percentage of the requests served within a certain time (ms)
  50%    342
  66%    401
  75%    456
  80%    499
  90%    678
  95%    948
  98%   1318
  99%   1632
 100%   3350 (longest request)

</pre>
<p>This was done on a Virtual Machine running in VirtualBox with 2 processors and 2GB of RAM. The host machine is an Intel i7-4702MQ CPU @ 2.20GHz.</p>
<p>24 Authentications per seconds, no failed requests look rather good to me.</p>
<p>So why not give it a try?</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.privacyidea.org/how-to-install-privacyidea-otp-server-on-ubuntu-14-04/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
