networking:freeradius-yubikey
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| networking:freeradius-yubikey [2025/10/04 17:26] – srohr_admin | networking:freeradius-yubikey [2025/10/17 04:45] (current) – [Testing using radtest] srohr_admin | ||
|---|---|---|---|
| Line 27: | Line 27: | ||
| apt install freeradius freeradius-yubikey rsyslog vim | apt install freeradius freeradius-yubikey rsyslog vim | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ===== Enable Freeradius YubiKey module ===== | ||
| + | |||
| + | |||
| + | cd / | ||
| + | |||
| + | |||
| ===== Allow clients to query Freradius ===== | ===== Allow clients to query Freradius ===== | ||
| In **/// | In **/// | ||
| + | \\ | ||
| + | |||
| + | cat clients.conf | sed -r '/ | ||
| < | < | ||
| Line 75: | Line 86: | ||
| + | in sites-enabled/ | ||
| + | |||
| + | < | ||
| + | |||
| + | listen { | ||
| + | type = auth | ||
| + | limit { | ||
| + | #srohr | ||
| + | # | ||
| + | idle_timeout = 30 | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | authorize { | ||
| + | #srohr - add yubikey section | ||
| + | yubikey | ||
| + | if (ok) { | ||
| + | update control { | ||
| + | Auth-Type := yubikey | ||
| + | } | ||
| + | pap | ||
| + | } | ||
| + | |||
| + | |||
| + | #srohr - enable "auth log" | ||
| + | # | ||
| + | auth_log | ||
| + | |||
| + | |||
| + | #srohr - disable " | ||
| + | #pap | ||
| + | | ||
| + | | ||
| + | #srohr - new section in new freerad - TLS. TBC if it needs to be removed | ||
| + | Autz-Type New-TLS-Connection { | ||
| + | ok | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | authenticate { | ||
| + | #srohr - Add yubikey section | ||
| + | Auth-Type yubikey { | ||
| + | yubikey | ||
| + | update request { | ||
| + | User-Password := " | ||
| + | } | ||
| + | pap | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | accounting { | ||
| + | |||
| + | #srohr - " | ||
| + | unix or #unix ????? | ||
| + | |||
| + | } | ||
| + | |||
| + | |||
| + | post-auth { | ||
| + | #srohr - on new freeradius below is configured. Doesn' | ||
| + | if (session-state: | ||
| + | update reply { | ||
| + | & | ||
| + | } | ||
| + | } | ||
| + | | ||
| + | if (EAP-Key-Name && & | ||
| + | update reply { | ||
| + | & | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | post-proxy { | ||
| + | |||
| + | #srohr - " | ||
| + | eap | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | Change values in / | ||
| + | |||
| + | < | ||
| + | yubikey { | ||
| + | decrypt = no | ||
| + | validate = yes | ||
| + | validation { | ||
| + | servers { | ||
| + | uri = ' | ||
| + | uri = ' | ||
| + | } | ||
| + | client_id = 62291 | ||
| + | api_key = ' | ||
| + | pool { | ||
| + | start = ${thread[pool].start_servers} | ||
| + | min = ${thread[pool].min_spare_servers} | ||
| + | max = ${thread[pool].max_servers} | ||
| + | uses = 0 | ||
| + | retry_delay = 30 | ||
| + | lifetime = 0 | ||
| + | idle_timeout = 60 | ||
| + | spread = yes | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Testing using radtest ===== | ||
| + | |||
| + | Successful: | ||
| + | |||
| + | < | ||
| + | radtest -x srohr Cisco123ccccccurvdnlbhdrtkjrihhbikhvklkkgvgftldgkjfd localhost 1812 testing123 | ||
| + | Sent Access-Request Id 248 from 0.0.0.0: | ||
| + | User-Name = " | ||
| + | User-Password = " | ||
| + | NAS-IP-Address = 127.0.1.1 | ||
| + | NAS-Port = 1812 | ||
| + | Message-Authenticator = 0x00 | ||
| + | Cleartext-Password = " | ||
| + | Received Access-Accept Id 248 from 127.0.0.1: | ||
| + | Message-Authenticator = 0x53728eccda8d30a6f9a9451136b7c4e6 | ||
| + | </ | ||
| + | |||
| + | Unsuccessful: | ||
| + | |||
| + | < | ||
| + | radtest -x srohr2 Cisco123ccccccurvdnlvetenvrhgjlcbvrcldegrbdgggfnjtnj localhost 1812 testing123 | ||
| + | Sent Access-Request Id 164 from 0.0.0.0: | ||
| + | User-Name = " | ||
| + | User-Password = " | ||
| + | NAS-IP-Address = 127.0.1.1 | ||
| + | NAS-Port = 1812 | ||
| + | Message-Authenticator = 0x00 | ||
| + | Cleartext-Password = " | ||
| + | Received Access-Reject Id 164 from 127.0.0.1: | ||
| + | Message-Authenticator = 0x078a3a6275d18b0f41277f9509c96312 | ||
| + | (0) -: Expected Access-Accept got Access-Reject | ||
| + | </ | ||
| + | |||
| + | shows config without empty lines and removes lines starting with '#' | ||
| + | |||
| + | < | ||
| + | cat sites-enabled/ | ||
| + | </ | ||
networking/freeradius-yubikey.1759595188.txt.gz · Last modified: 2025/10/04 17:26 by srohr_admin
