SSLVPN Two Factor Authentication With Google Authenticator
SSLVPN Two Factor Authentication With Google Authenticator
1 / 25
1 Background
2 / 25
2 FreeRADIUS & Google Authenticator
Two-Factor Authentication
Google Authenticator is a great free dual factor authentication system. "The
Google Authenticator project includes implementations of one-time passcode
generators for several mobile platforms". It can be used in conjunction with
FreeRADIUS to provide Free 2 factor authentication.
3 / 25
At first, you will need to complete a minimal installation of CentOS 7 build
1503 or RHEL 7.1 and yum update.
Required Components:
• CentOS 7 (1503) or Red Hat Enterprise Linux 7.1 Minimal
• FreeRADIUS
• System Security Services Daemon (SSSD)
• Google Authenticator Pam Library, Service, & APP
• Pluggable Authentication Module (PAM)
Test Topology:
Configuration Steps:
1. Install CentOS 7
YUM update
Note:
This solution's use of FreeRADIUS must run as root to access the .google_authenticator
6 / 25
Edit sites-enabled/default
Uncomment pam
Enable PAM
Configure clients.conf
client 10.0.0.16{
ipaddr = 10.0.0.16
secret = hillstone
require_message_authenticator = no
nas_type = other
# vi /etc/raddb/users
Find below
Update to
8 / 25
Received Access-Accept should be the response, otherwise you will receive a reject. If
so, backup and check your work and correct errors before proceeding.
Note:
If you see error "realm: Couldn't connect to realm service: Error calling
Test SSSD
# radiusd -X
[root@centos7radius ~]# radtest [email protected] your_password localhost 0
testing123
Sent Access-Request Id 144 from 0.0.0.0:35469 to 127.0.0.1:1812 length 84
User-Name = "[email protected]"
User-Password = "your_password"
NAS-IP-Address = 10.0.0.199
NAS-Port = 0
Message-Authenticator = 0x00
Cleartext-Password = "your_password"
9 / 25
Received Access-Accept Id 144 from 127.0.0.1:1812 to 0.0.0.0:0 length 20
[root@centos7radius google-authenticator-libpam]# cd ~
10 / 25
[root@centos7radius ~]# su - [email protected]
Creating home directory for [email protected].
https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://tot
p/[email protected]@centos7radius%3Fsecret%3DWASLQBOJ7SC5CWN3CB
RT62AMOY%26issuer%3Dcentos7radius
Open Google Authenticator App on mobile phone and scan the QR Code and input the
11 / 25
Note:
At this free solution, there is no user self-service portal, the administrator need to
generate the QR code on FreeRADIUS server manually for each user and then send the
12 / 25
https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth:
//totp/[email protected]@centos7radius%3Fsecret%3DWASLQBOJ7SC5CWN3CBRT62
AMOY%26issuer%3Dcentos7radius
End users can open the link in browser if they have internet access, since this QR code
(during the setup, the administrator can input -1 to skip the code verification < Enter code
13 / 25
Code confirmed
Your emergency scratch codes are:
43322639
34705877
32173950
41646850
82907757
If the computer that you are logging into isn't hardened against brute-force
login attempts, you can enable rate-limiting for the authentication module.
By default, this limits attackers to no more than 3 login attempts every 30s.
Do you want to enable rate-limiting? (y/n) y
0 testing123
16 / 25
Password is AD account password with code from Google Authenticator App
17 / 25
9. Firewall: Configure SSLVPN and use
CentOS7Radius as authentication server
18 / 25
19 / 25
20 / 25
21 / 25
10. Test login on SCVPN Client
22 / 25
When connecting to SSLVPN server, the Password here is AD account password with
and the code in Google Authenticator app is 666 666. The Password you need to input
In this solution as we use SSSD to integrate with Win AD, the account information is only
➢ Radius verify the password with Win AD server via Kerberos. This process should be
➢ Radius reply the authentication result to firewall, if passed, the VPN connection is
established
23 / 25
Check SSLVPN Connection
24 / 25
Try to ping server in LAN
Note:
There will be an issue in reconnection if SCVPN disconnected. You need to change the
25 / 25