# MFA on Openwrt SSH & LuCi

**URL:** <https://forum.openwrt.org/t/mfa-on-openwrt-ssh-luci/29941>\
**Category:** Site Feedback and Other Questions\
**Created:** [January 25, 2019, 6:21pm UTC](https://forum.openwrt.org/t/mfa-on-openwrt-ssh-luci/29941 "2019-01-25T18:21:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mying](https://forum.openwrt.org/letter_avatar/mying/32/5_5575768a8748004e209b776fc1b2916d.png) [@mying](https://forum.openwrt.org/u/mying)\
**Post date:** [January 25, 2019, 6:21pm UTC](https://forum.openwrt.org/t/mfa-on-openwrt-ssh-luci/29941/1 "2019-01-25T18:21:04Z")

</div>

I'm curious if there are plans to add MultiFactor Authentication to LuCi like Google Authenticator and if it's already possible to do multifactor authentication when SSHing to openwrt router.

Thanks

---

<div class="post-metadata">

**Author:** ![jeff](https://forum.openwrt.org/letter_avatar/jeff/32/5_5575768a8748004e209b776fc1b2916d.png) [@jeff](https://forum.openwrt.org/u/jeff)\
**Post date:** [January 25, 2019, 6:27pm UTC](https://forum.openwrt.org/t/mfa-on-openwrt-ssh-luci/29941/2 "2019-01-25T18:27:46Z")

</div>

I would be surprised if `dropbear` can support MFA, but there are several articles on how to configure OpenSSH for MFA. As one example

> **[How To Set Up Multi-Factor Authentication for SSH on Ubuntu 16.04 | DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-set-up-multi-factor-authentication-for-ssh-on-ubuntu-16-04)**
>
> This article will go over how to enable SSH authentication using an OATH-TOTP app in addition to an SSH key. Logging into your server via SSH will then require two factors across two channels, thereby making it more secure than a password or SSH key...

_Edit:_

Running nginx (which is now a "LuCI option" on at least `master`) instead of `uhttpd` would probably be the first step to MFA for LuCI. There might be some good tidbits at

> **[cloudflare/nginx-google-oauth](https://github.com/cloudflare/nginx-google-oauth)**
>
> Lua module to add Google OAuth to nginx. Contribute to cloudflare/nginx-google-oauth development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![slh](https://forum.openwrt.org/user_avatar/forum.openwrt.org/slh/32/113591_2.png) [@slh](https://forum.openwrt.org/u/slh)\
**Post date:** [January 25, 2019, 7:46pm UTC](https://forum.openwrt.org/t/mfa-on-openwrt-ssh-luci/29941/3 "2019-01-25T19:46:45Z")

</div>

Aside from handing over the keys to the castle to one of the big cloud providers sounds like a terrible idea to me personally, you do need to consider that you need to have access to your router most, whenever the internet is not accessible, so relying on any remote service for authentification of local devices is not a good choice (that also applies to basic commodities as heating, light, locks, etc.).

---

<div class="post-metadata">

**Author:** ![vgaetera](https://forum.openwrt.org/user_avatar/forum.openwrt.org/vgaetera/32/113586_2.png) [@vgaetera](https://forum.openwrt.org/u/vgaetera)\
**Post date:** [January 25, 2019, 8:09pm UTC](https://forum.openwrt.org/t/mfa-on-openwrt-ssh-luci/29941/4 "2019-01-25T20:09:02Z")

</div>

[https://openwrt.org/docs/guide-user/services/vpn/start](https://openwrt.org/docs/guide-user/services/vpn/start)

---

<div class="post-metadata">

**Author:** ![Mushoz](https://forum.openwrt.org/user_avatar/forum.openwrt.org/mushoz/32/49821_2.png) [@Mushoz](https://forum.openwrt.org/u/Mushoz)\
**Post date:** [January 26, 2019, 1:26pm UTC](https://forum.openwrt.org/t/mfa-on-openwrt-ssh-luci/29941/5 "2019-01-26T13:26:54Z")

</div>

> [@slh](#):
>
> Aside from handing over the keys to the castle to one of the big cloud providers sounds like a terrible idea to me personally

Google Authenticator is simply one implementation of a common two factor authentication algorithm. It does not require the internet nor Google. It happens completely offline on the device doing the authentication (the router in this case) and the device generating the one-time-use keys (the phone).

---

<div class="post-metadata">

**Author:** ![jow](https://forum.openwrt.org/user_avatar/forum.openwrt.org/jow/32/13_2.png) [@jow](https://forum.openwrt.org/u/jow)\
**Post date:** [January 26, 2019, 1:57pm UTC](https://forum.openwrt.org/t/mfa-on-openwrt-ssh-luci/29941/6 "2019-01-26T13:57:21Z")

</div>

Problem is that one time token solutions also require exact system time which - in case the router has neither connectivity, nor RTC, nor GPS - is not available either.

---

<div class="post-metadata">

**Author:** ![slh](https://forum.openwrt.org/user_avatar/forum.openwrt.org/slh/32/113591_2.png) [@slh](https://forum.openwrt.org/u/slh)\
**Post date:** [January 26, 2019, 7:37pm UTC](https://forum.openwrt.org/t/mfa-on-openwrt-ssh-luci/29941/7 "2019-01-26T19:37:40Z")

</div>

What would technically work (but you'd still have to invest a lot of work to implement it), would be either requiring to press a button (e.g. the largely unused WPS button) or USB based smartcard (rfid/ nfc --\> libccid/ pcscd) readers or fingerprint readers (--\> fprintd), just be aware that there's probably (almost) no infrastructure in place for that (there just is no full fledged PAM setup in place).

---

<div class="post-metadata">

**Author:** ![noseratio](https://forum.openwrt.org/user_avatar/forum.openwrt.org/noseratio/32/19898_2.png) [@noseratio](https://forum.openwrt.org/u/noseratio)\
**Post date:** [February 9, 2021, 9:34pm UTC](https://forum.openwrt.org/t/mfa-on-openwrt-ssh-luci/29941/8 "2021-02-09T21:34:53Z")

</div>

> [@mying](#):
>
> if it's already possible to do multifactor authentication when SSHing to openwrt router.

Possible with OpenSSH, I've posted [a howto](https://forum.openwrt.org/t/howto-openssh-with-mfa-on-openwrt-19-07-x-using-google-authenticator/88025).
