Installing Google Authenticator for SSH, OpenConnect, OpenVPN?

Hi, I had a similar problem (for OpenSSH)... and I think I solved it.

Published the Makefile to Github: https://github.com/redorbluepill/openwrt-google-authenticator

I have implemented this for OpenSSH as follows (as an example):

  1. Save the makefile in a package folder of your choosing (see the "Hello World" example on OpenWRT.org) and add this to the feeds.conf.default file;
  2. "./scripts/feeds clean"
  3. "./scripts/feeds update -a"
  4. "./scripts/feeds install openssh-server-pam"
  5. "make menuconfig" and select the packages "openssh-server-pam" in Network - SSH and "libpam-google-authenticator" in Utilities. Make sure to select the M option and not *.
  6. Save the config and run "make -j$(nproc * 1.5)"
  7. Move the packages from //src/bin/packages// to the OpenWrt router and install / force install

You will need to do all the additional configs for Openssh though, like moving Dropbear to another port and change some of the config for Openssh.
Works fine on my OpenWrt 18.06.2 on a BT HomeHub 5A (target: mips_24k)

I hope this helps for the Google Authenticator bit. I have not tested this for OpenVPN.

Cheers

3 Likes