This is an old revision of the document!
FreeRADIUS with LDAP
Introduction
- FreeRADIUS includes support for LDAP integration.
- To ensure maximum benefit of RADIUSdesk we will use a hybrid setup for LDAP integration.
- The next section will be used as a basic introduction to FreeRADIUS and LDAP
Basic FreeRADIUS with LDAP
OpenLDAP
Install OpenLDAP
- We will install OpenLDAP and do a basic setup that can be used by FreeRADIUS.
- When you install OpenLDAP (slapd) the package installer will ask you to provide a password.
- Provide one but keep in mind that we will reconfigure everything after the install.
- OpenLDAP server is called slapd.
- The program to extract info from the OpenLDAP directory is called slapcat.
# Update repository lists sudo apt update # Install OpenLDAP and standard utility tools sudo apt install -y slapd ldap-utils # Install the FreeRADIUS LDAP module (rlm_ldap) sudo apt install -y freeradius-ldap
Configure OpenLDAP
- After the slapd package installed we can run the following command to reconfigure slapd and provide a basic setup.
# Configure or reconfigure slapd defaults interactively sudo dpkg-reconfigure slapd
- Omit OpenLDAP server configuration? No.
- DNS domain name: Enter your domain (e.g., radiusdesk.com creating dc=radiusdesk,dc=com).
- Organization name: Enter your organization name (We specified radiusdesk).
- Administrator password: We used a simple password since we're testing.
- After you answered these questions slapd should be reconfigured with those items.
Check OpenLDAP
- You can confirm it by issuing the following command
sudo slapcat dn: dc=radiusdesk,dc=com objectClass: top objectClass: dcObject objectClass: organization o: radiusdesk dc: radiusdesk structuralObjectClass: organization entryUUID: 8c68dc16-1a3f-1041-9add-250d07e316fc creatorsName: cn=admin,dc=radiusdesk,dc=com createTimestamp: 20260722173600Z entryCSN: 20260722173600.213629Z#000000#000#000000 modifiersName: cn=admin,dc=radiusdesk,dc=com modifyTimestamp: 20260722173600Z
- This confirms the basic setup of slapd.
- Next we will add an Organizational Unit (OU) under which we can add our users. (Remember LDAP is a directory/hierarchy)
Create the Organizational Unit (OU)
- Create a file named ou.ldif to set up a dedicated container for your network accounts.
- ou.ldif
dn: ou=people,dc=radiusdesk,dc=com objectClass: organizationalUnit ou: people
- Apply this file to your OpenLDAP directory:
ldapadd -x -D "cn=admin,dc=radiusdesk,dc=com" -W -f ou.ldif
Create the User Account
- Create a file named user.ldif.
- This template creates a user named testuser with the password mysecretpassword.
- user.ldif
dn: uid=testuser,ou=people,dc=radiusdesk,dc=com objectClass: top objectClass: account objectClass: simpleSecurityObject uid: testuser userPassword: mysecretpassword description: RADIUS Test User
- Apply this file to your OpenLDAP directory:
ldapadd -x -D "cn=admin,dc=radiusdesk,dc=com" -W -f user.ldif
- If you run slapcat again these items should be in the reply.
sudo slapcat dn: dc=radiusdesk,dc=com objectClass: top objectClass: dcObject objectClass: organization o: radiusdesk dc: radiusdesk structuralObjectClass: organization entryUUID: 8c68dc16-1a3f-1041-9add-250d07e316fc creatorsName: cn=admin,dc=radiusdesk,dc=com createTimestamp: 20260722173600Z entryCSN: 20260722173600.213629Z#000000#000#000000 modifiersName: cn=admin,dc=radiusdesk,dc=com modifyTimestamp: 20260722173600Z dn: ou=people,dc=radiusdesk,dc=com objectClass: organizationalUnit ou: people structuralObjectClass: organizationalUnit entryUUID: a6c420c6-1a48-1041-895a-41f787ad35f7 creatorsName: cn=admin,dc=radiusdesk,dc=com createTimestamp: 20260722184109Z entryCSN: 20260722184109.903088Z#000000#000#000000 modifiersName: cn=admin,dc=radiusdesk,dc=com modifyTimestamp: 20260722184109Z dn: uid=testuser,ou=people,dc=radiusdesk,dc=com objectClass: top objectClass: account objectClass: simpleSecurityObject uid: testuser userPassword:: bXlzZWNyZXRwYXNzd29yZA== description: RADIUS Test User structuralObjectClass: account entryUUID: f0928490-1a48-1041-895b-41f787ad35f7 creatorsName: cn=admin,dc=radiusdesk,dc=com createTimestamp: 20260722184313Z entryCSN: 20260722184313.729405Z#000000#000#000000 modifiersName: cn=admin,dc=radiusdesk,dc=com modifyTimestamp: 20260722184313Z