FreeRADIUS
Overview
This guide shows you how to deploy and configure FreeRADIUS on Ubuntu 24.04 using SecureAnyCloud Azure Marketplace images. FreeRADIUS is the most widely deployed RADIUS server in the world. It provides centralised authentication, authorisation and accounting (AAA) for network access. Wi-Fi access points, VPN concentrators, 802.1X switches and captive portals all ask FreeRADIUS whether a user may connect, and record how long they were connected.
The image installs FreeRADIUS 3.2 from the official Ubuntu 24.04 apt archive. It runs under systemd as the dedicated non-root freerad user. FreeRADIUS answers RADIUS authentication on UDP port 1812 and accounting on UDP port 1813 across all interfaces. There is no web interface and no database in this image. The configuration tree under /etc/freeradius/3.0 plus a flat user file are the whole configuration.
Secure by default, with no known bootstrap credential. The stock FreeRADIUS package ships a well known client shared secret, testing123, and a demonstration bob user. Neither ships in this image. On the first boot of every VM, a one-shot service generates a unique random shared secret for the built-in localhost client and a unique sample user and password. It writes them to a root-owned credentials file and removes testing123 from the entire configuration. No two instances share a credential.
What you get:
- FreeRADIUS 3.2 from the Ubuntu 24.04 apt archive, run under systemd as the unprivileged
freeraduser (freeradius.service) - A RADIUS authentication listener on
0.0.0.0:1812and a RADIUS accounting listener on0.0.0.0:1813, both over UDP on all interfaces - A per-instance unique shared secret for the built-in
127.0.0.1client and a unique sample user and password, generated on first boot and written to/root/freeradius-credentials.txt(mode 0600) - The standard
filesandpapauthorisation flow, so a PAP client such asradtestauthenticates the sample user out of the box - A clean
clients.confthat includes theclients.d/directory, so you add each NAS device as its own small configuration file - The well known
testing123shared secret and the demonstration user, removed from the whole configuration tree
Prerequisites
- A VM launched from this SecureAnyCloud FreeRADIUS image on Azure.
- An Azure Network Security Group that allows UDP 1812 and UDP 1813 inbound from your NAS devices only (access points, switches, VPN concentrators). Do not expose RADIUS to the public internet.
- SSH access to the VM as
azureuser.
RADIUS clients authenticate with a shared secret. Treat the shared secret like a password, and scope the NSG rules to the source addresses of your network equipment.
Verify the RADIUS server is running
Connect over SSH as azureuser. Then confirm that freeradius.service is active and listening on the authentication and accounting ports.
sudo systemctl is-active freeradius
sudo ss -uln | grep -E ':1812 |:1813 'The output shows active, with listeners bound to 0.0.0.0:1812 (authentication) and 0.0.0.0:1813 (accounting), plus their IPv6 equivalents.
Retrieve the per-instance credentials and test authentication
On the first boot of your VM, FreeRADIUS generated a unique shared secret and a unique sample user and password. They are stored in the root-owned credentials file:
sudo cat /root/freeradius-credentials.txtThe file contains RADIUS_SECRET, SAMPLE_USER and SAMPLE_PASSWORD, each unique to this VM. Test authentication end to end with the bundled radtest client. It reads those values and sends a PAP Access-Request to the built-in localhost client:
RADIUS_SECRET=$(sudo grep '^RADIUS_SECRET=' /root/freeradius-credentials.txt | cut -d= -f2-)
SAMPLE_USER=$(sudo grep '^SAMPLE_USER=' /root/freeradius-credentials.txt | cut -d= -f2-)
SAMPLE_PASSWORD=$(sudo grep '^SAMPLE_PASSWORD=' /root/freeradius-credentials.txt | cut -d= -f2-) radtest "$SAMPLE_USER" "$SAMPLE_PASSWORD" localhost 0 "$RADIUS_SECRET"The server returns Access-Accept with the reply message configured for the sample user. This proves that the RADIUS pipeline (client shared secret, users backend and PAP authentication) works end to end.
Confirm invalid credentials are rejected
A correctly configured RADIUS server must reject bad credentials. This image also removes the well known testing123 shared secret that ships with the stock package. Run the block below to test that a wrong password is rejected:
RADIUS_SECRET=$(sudo grep '^RADIUS_SECRET=' /root/freeradius-credentials.txt | cut -d= -f2-)
SAMPLE_USER=$(sudo grep '^SAMPLE_USER=' /root/freeradius-credentials.txt | cut -d= -f2-)
RESULT=$(radtest "$SAMPLE_USER" "the-wrong-password" localhost 0 "$RADIUS_SECRET" 2>&1 || true)
echo "$RESULT" | grep -q 'Access-Reject' && echo "A wrong password is correctly rejected (Access-Reject)."A request with the wrong password returns Access-Reject. A request signed with the old testing123 shared secret does not authenticate, because that secret is no longer present anywhere in the configuration.
Add a RADIUS client (a NAS device)
Every network device that authenticates users through FreeRADIUS is a RADIUS client (a NAS, network access server) and needs its own shared secret. The shipped clients.conf includes the clients.d/ directory, so you add one small file per device. View the shipped file:
sudo cat /etc/freeradius/3.0/clients.confTo authorise a wireless access point at 192.0.2.50, for example, create a file such as /etc/freeradius/3.0/clients.d/office-ap.conf with a client block. Choose a long, random shared secret and configure the same secret on the access point:
client office-ap { ipaddr = 192.0.2.50 secret = choose-a-long-random-shared-secret nas_type = other }You can also authorise a whole subnet of devices by giving ipaddr a CIDR such as 10.20.0.0/24. After you add or change a client, restart the service so that it re-reads the configuration:
sudo systemctl restart freeradiusAdd a user
This image uses the simple flat files backend. Users live in /etc/freeradius/3.0/mods-config/files/sac-users, which the standard authorize file includes. Add one entry per user. For a PAP user with a cleartext password, add a block like this. Indent the continuation lines:
alice Cleartext-Password := "choose-a-strong-password" Reply-Message := "Welcome, %{User-Name}"To attach reply attributes such as a VLAN assignment for 802.1X, add Tunnel-Type, Tunnel-Medium-Type and Tunnel-Private-Group-Id reply items. After you edit the users file, restart the service:
sudo systemctl restart freeradiusFor production directories, point FreeRADIUS at an LDAP or SQL backend instead of the flat file. Enable the ldap or sql module under /etc/freeradius/3.0/mods-enabled/ and adjust the authorize and authenticate sections.
For enterprise Wi-Fi and wired 802.1X, enable the eap module and configure the EAP methods your clients use.
Point your NAS devices at the server
On each access point, switch or VPN concentrator, configure the RADIUS server address (this VM's private or public IP), the authentication port 1812, the accounting port 1813, and the shared secret you set for that device in its clients.d/ file.
Keep the NSG rules scoped to your equipment and rotate shared secrets periodically. For wireless authentication, prefer EAP methods over PAP.
Support
SecureAnyCloud provides 24/7 technical support for this FreeRADIUS image by email (sales@secureanycloud.com) and live chat. We help with adding RADIUS clients and users, migrating to LDAP or SQL backends, configuring EAP and 802.1X for enterprise Wi-Fi, RADIUS accounting, reply attributes such as VLAN assignment, version upgrades and troubleshooting.
Critical issues receive a one hour average response time.
All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Deploy on Azure
Launch FreeRADIUS 3.2 on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
This guide shows you how to deploy and configure FreeRADIUS on AWS using SecureAnyCloud AWS Marketplace images. FreeRADIUS is the most widely deployed RADIUS server in the world and the basis of many commercial RADIUS products. It provides centralised authentication, authorisation and accounting (AAA) for network access. Wi-Fi access points, VPN concentrators, 802.1X switches, captive portals and network access servers all ask FreeRADIUS whether a user may connect, and record how long they were connected.
The image installs FreeRADIUS 3.2 from the official distribution package. It runs under systemd as the dedicated non-root freerad user. FreeRADIUS answers authentication on UDP 1812 and accounting on UDP 1813 across all interfaces. There is no web interface and no database. The configuration tree under /etc/freeradius/3.0 plus a flat user file are the whole configuration, so version-controllable text defines the server and one command reloads it.
Secure by default, with no known bootstrap credential. The stock FreeRADIUS package ships a well known client shared secret, testing123, and a demonstration user. Neither ships in this image. The testing123 secret is removed from the entire configuration, and the demo user is stripped.
On the first boot of every instance, a one-shot service generates a unique random shared secret for the built-in localhost client and a unique sample user and password for that specific instance. It writes them to a root-only credentials file. No two instances share a credential, so nobody can authenticate against the image with a published default.
What you get:
- FreeRADIUS 3.2 from the official distribution package, run under systemd as the dedicated non-root
freeraduser (freeradius.service) - A RADIUS authentication listener on
0.0.0.0:1812(UDP) and a RADIUS accounting listener on0.0.0.0:1813(UDP) - The standard
filesandpapauthorisation flow, so a standard RADIUS client such asradtestauthenticates a user against the flat user file out of the box - A per-instance shared secret and a per-instance sample user + password, generated on first boot and written to
/root/freeradius-credentials.txt(mode0600, root only) - The well known
testing123shared secret and the stock demonstration user removed from the configuration tree - A
clients.confthat$INCLUDEs an emptyclients.d/directory, so you add your own RADIUS clients as drop-in.conffiles, and asac-usersfile for your own users, both reloadable with one command
Connecting to your instance
Connect over SSH on port 22 as the default login user for the AMI variant you launched. FreeRADIUS ships with no login of its own. The per-instance RADIUS credentials live in a root-only file on the instance.
On Ubuntu 24.04 LTS, the SSH login user is ubuntu. The service is freeradius.service, and the configuration is at /etc/freeradius/3.0.
ssh -i /path/to/key.pem ubuntu@<public-ip>Prerequisites
- An AWS account and a key pair in the target region.
- A subscription to the FreeRADIUS listing on AWS Marketplace.
- A security group that allows TCP 22 (admin) from your address, and UDP 1812 and UDP 1813 from the NAS devices (access points, switches, VPN concentrators) that will authenticate against the server.
Recommended instance type: m5.large (2 vCPU, 8 GB RAM) is ample for a departmental or site RADIUS server. FreeRADIUS is very light. You need larger sizes only for very high authentication volumes or EAP-heavy 802.1X estates.
Launch from AWS Marketplace
Search for FreeRADIUS in AWS Marketplace and select the SecureAnyCloud listing. Choose Continue to Subscribe, then Continue to Configuration, then Continue to Launch.
Choose the m5.large instance type, your key pair, and a security group. Configure the security group to allow UDP 1812 and UDP 1813 only from the RADIUS clients that will authenticate against the server, and TCP 22 for administration. Never open the RADIUS ports to the whole internet.
Launch from the AWS CLI
AWS_REGION="us-east-1" aws ec2 run-instances \
--region "$AWS_REGION" \
--image-id <freeradius-ami-id> \
--instance-type m5.large \
--key-name <your-key-pair> \
--security-group-ids <your-sg-id> \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=freeradius1}]'First boot
On first boot, a one-shot service (freeradius-firstboot.service) does four things. It generates this instance's unique RADIUS shared secret and a unique sample user and password. It renders the built-in localhost client into clients.d/localhost.conf. It writes the per-instance user into mods-config/files/sac-users. It records everything in /root/freeradius-credentials.txt (mode 0600).
Only then does freeradius.service start, so the server never comes up with an unconfigured client. First boot completes within a few seconds of the instance becoming reachable.
Read the per-instance credentials:
sudo cat /root/freeradius-credentials.txtConfirm the service is running
systemctl is-active freeradius freeradius -v | head -1 sudo ss -ulnp | grep -E ':1812|:1813'The service is active. freeradius -v reports FreeRADIUS Version 3.2.5, and FreeRADIUS is listening on UDP 1812 (authentication) and UDP 1813 (accounting).
Test authentication with radtest
The image ships radtest (from freeradius-utils). Load this instance's secret and sample user from the root-only credentials file, and authenticate against the built-in localhost client:
source <(sudo grep -E '^(RADIUS_SECRET|SAMPLE_USER|SAMPLE_PASSWORD)=' /root/freeradius-credentials.txt) radtest "$SAMPLE_USER" "$SAMPLE_PASSWORD" 127.0.0.1 0 "$RADIUS_SECRET"You receive an Access-Accept with a Reply-Message. This proves end-to-end AAA: the per-instance sample user authenticates against the localhost client using the per-instance shared secret.
Confirm the image is secure by default
Check that a wrong password for a valid user is rejected, and that the well known stock testing123 shared secret does not authenticate:
source <(sudo grep -E '^(RADIUS_SECRET|SAMPLE_USER|SAMPLE_PASSWORD)=' /root/freeradius-credentials.txt) REJ="$(radtest "$SAMPLE_USER" wrong-password 127.0.0.1 0 "$RADIUS_SECRET" 2>&1 || true)" echo "$REJ" | grep -q 'Access-Reject' && echo 'wrong password -> Access-Reject (correct)' || echo 'unexpected: wrong password was not rejected' BAD="$(timeout 8 radtest "$SAMPLE_USER" "$SAMPLE_PASSWORD" 127.0.0.1 0 testing123 2>&1 || true)" echo "$BAD" | grep -q 'Access-Accept' && echo 'FAIL: testing123 authenticated' || echo 'testing123 shared secret -> rejected (correct)'Both checks confirm that no known bootstrap credential ships in the image. A wrong password is rejected, and the stock testing123 secret is not accepted.
Review the configuration tree
FreeRADIUS is driven entirely by the configuration tree under /etc/freeradius/3.0. clients.conf $INCLUDEs the clients.d/ directory (where the per-instance localhost client lives and where you add your own clients). The per-instance sample user lives in mods-config/files/sac-users:
sudo ls /etc/freeradius/3.0/
sudo grep INCLUDE /etc/freeradius/3.0/clients.conf
sudo ls -l /root/freeradius-credentials.txtAdd your own RADIUS clients
Each network access server (access point, switch, VPN concentrator, captive portal) is a RADIUS client with its own shared secret. Add one as a drop-in .conf file under clients.d/, then reload. Set ipaddr to your device's address or your NAS management subnet (<your-mgmt-cidr>), and choose a strong secret:
sudo tee /etc/freeradius/3.0/clients.d/site-nas.conf >/dev/null <<'CLIENT' client site-nas { ipaddr = <your-mgmt-cidr> secret = choose-a-strong-per-device-secret nas_type = other } CLIENT
sudo systemctl restart freeradiusConfigure the same shared secret on the network device so it can talk to the RADIUS server.
Add your own users
Add users to the flat file backend by editing mods-config/files/sac-users, then reload:
sudo nano /etc/freeradius/3.0/mods-config/files/sac-users
# add e.g.:
# alice Cleartext-Password := "<new-password>"
# Reply-Message := "Welcome %{User-Name}"
sudo systemctl restart freeradiusFor production, you will typically grow beyond the flat file into an LDAP or SQL backend and enable EAP methods for 802.1X and enterprise Wi-Fi. SecureAnyCloud engineers can help you design these after purchase.
Security recommendations
- Restrict the RADIUS ports. Open UDP 1812 and UDP 1813 in the security group only to the NAS devices that authenticate against the server, never to the whole internet.
- Use a unique shared secret per client. Give every access point, switch or VPN concentrator its own strong secret in its own
clients.d/file. - Keep the credentials file protected.
/root/freeradius-credentials.txtis mode0600and readable only by root. Do not relax its permissions or copy the per-instance secret onto other hosts. - Prefer EAP for Wi-Fi. For enterprise Wi-Fi and 802.1X, use an EAP method (PEAP/EAP-TLS) with TLS rather than bare PAP, and consider an LDAP or SQL user backend.
- Patch regularly. Apply operating system and FreeRADIUS security updates. SecureAnyCloud provides upgrade and patch guidance.
Support and Licensing
FreeRADIUS is open source software licensed under the GNU General Public License, version 2. This image repackages the upstream distribution package. Additional charges apply for SecureAnyCloud support services.
FreeRADIUS is a trademark of its respective owner. This image is not affiliated with or endorsed by the FreeRADIUS project.
Deploy on AWS
Subscribe to the FreeRADIUS listing on AWS Marketplace and launch the m5.large instance. Within minutes you have a hardened RADIUS server answering authentication requests.
Need Help?
SecureAnyCloud provides 24/7 technical support by email (sales@secureanycloud.com) and live chat. We help with adding RADIUS clients and users, migrating to LDAP or SQL backends, configuring EAP and 802.1X for enterprise Wi-Fi, RADIUS accounting, per-user reply attributes such as VLAN assignment, and FreeRADIUS version upgrades. Critical issues receive a one hour average response time.
Deploy on AWS
Launch FreeRADIUS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com