<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>MFA/IMathAccount</title><revhistory><revision><revnumber>15</revnumber><date>2025-11-29 12:45:18</date><authorinitials>crose</authorinitials></revision><revision><revnumber>14</revnumber><date>2025-11-29 12:44:57</date><authorinitials>crose</authorinitials></revision><revision><revnumber>13</revnumber><date>2025-11-29 12:44:27</date><authorinitials>crose</authorinitials></revision><revision><revnumber>12</revnumber><date>2025-11-29 12:43:21</date><authorinitials>crose</authorinitials></revision><revision><revnumber>11</revnumber><date>2025-11-29 12:43:04</date><authorinitials>crose</authorinitials></revision><revision><revnumber>10</revnumber><date>2025-11-29 12:42:43</date><authorinitials>crose</authorinitials></revision><revision><revnumber>9</revnumber><date>2025-11-29 12:41:39</date><authorinitials>crose</authorinitials></revision><revision><revnumber>8</revnumber><date>2025-11-29 11:33:51</date><authorinitials>crose</authorinitials></revision><revision><revnumber>7</revnumber><date>2025-10-06 09:32:14</date><authorinitials>kputyr</authorinitials></revision><revision><revnumber>6</revnumber><date>2025-06-19 07:59:10</date><authorinitials>kputyr</authorinitials></revision><revision><revnumber>5</revnumber><date>2025-05-16 10:57:30</date><authorinitials>crose</authorinitials></revision><revision><revnumber>4</revnumber><date>2025-05-16 10:10:44</date><authorinitials>kputyr</authorinitials></revision><revision><revnumber>3</revnumber><date>2025-05-16 09:22:29</date><authorinitials>kputyr</authorinitials></revision><revision><revnumber>2</revnumber><date>2025-05-16 09:20:24</date><authorinitials>crose</authorinitials></revision><revision><revnumber>1</revnumber><date>2025-05-16 08:52:21</date><authorinitials>kputyr</authorinitials></revision></revhistory></articleinfo><section><title>Securing I-MATH account with MFA</title><para>There are two different options to secure access: </para><orderedlist numeration="arabic"><listitem><para>SSH private/public keys </para></listitem><listitem><para>MFA OTP authentication </para></listitem></orderedlist><para><emphasis role="strong">Both</emphasis> can be configured in <emphasis role="strong">parallel</emphasis> and it is useful to configure both.  </para><section><title>SSH via private/public key</title><itemizedlist><listitem><para>+ Is most secure. </para></listitem><listitem><para>+ Handy if you use the same computer to login to I-MATH hosts.  </para></listitem><listitem><para>- Needs to be configured on each device which is used for SSH connection. </para></listitem><listitem><para><ulink url="https://wiki.math.uzh.ch/public/MFA/IMathAccount/public/ssh#Quick_Start">Setup</ulink> </para></listitem></itemizedlist></section><section><title>SSH via Time-based One-Time Password (TOTP)</title><itemizedlist><listitem><para>On the first login of a period, you have to provide a one-time-token (TOTP). </para></listitem><listitem><para>+ One Setup can be used on multiple devices </para></listitem><listitem><para>- Needs manual interaction on each new session (=connection). </para></listitem></itemizedlist><para><emphasis>The second factor is required to access the <ulink url="https://wiki.math.uzh.ch/public/MFA/IMathAccount/public/ssh#">ssh</ulink> server if there is no ssh private/public key setup.</emphasis> </para><section><title>TOTP login process</title><itemizedlist><listitem><para>Step 1: Connect to a SSH server with the username. </para></listitem><listitem><para>Step 2: Provide the password. </para></listitem><listitem><para>Step 3: The user is queried for a six-digit one-time token </para><itemizedlist><listitem override="none"><screen><![CDATA[0-~> ssh username@ssh.math.uzh.ch
(username@ssh.math.uzh.ch) Password: 
(username@ssh.math.uzh.ch) One-time token (see https://wiki.math.uzh.ch/public/MFA/IMathAccount): 123456]]></screen></listitem></itemizedlist></listitem></itemizedlist></section><section><title>Preparation: Configuring MFA via TOTP</title><itemizedlist><listitem><para>Login to <ulink url="https://wiki.math.uzh.ch/public/MFA/IMathAccount/public/thinlinc#">ThinLinc</ulink>. </para></listitem><listitem><para>Open a terminal: click on the menu in the lower left corner, type 'terminal'. </para><itemizedlist><listitem override="none"><screen><![CDATA[$ authenticator init]]></screen></listitem></itemizedlist></listitem><listitem><para>Open Microsoft Authenticator or Google Authenticator or KeepassXC or any other authenticator app which is capable to generate TOTP token. </para></listitem><listitem><para>Scan the QR code with the app  or use the secret key displayed below the code. </para></listitem><listitem><para>First time use:  </para><itemizedlist><listitem><para>Enter a six-digit code from the app into the terminal to confirm the configuration. </para></listitem><listitem><para>The terminal lists 5 recovery codes: store them in a secure place. You can use those codes anytime to gain access, i.e. when you forgot/lost/changed your phone. </para></listitem></itemizedlist></listitem></itemizedlist><para><emphasis role="strong">Warning</emphasis> Use with care: running the command will overwrite any current configuration, invalidating your current authenticating device! </para></section><section><title>Restoring/regenerating recovery codes</title><para>The recovery codes can be regenerated with <code>authenticator refresh</code> and displayed with <code>authenticator show codes</code>. </para></section><section><title>Late configuration of authenticator apps</title><para>If you no longer have the QR code, you can still configure most authenticator apps with the OTP secret. It is printed with the command <code>authenticator show secret</code>. </para></section></section></section></article>