FreeRADIUS is an open-source, full-featured RADIUS server that provides users with the means of implementing enterprise-level authentication, authorization, and accounting protocols for various network-based services. In this tutorial, we’ll outline the steps required to install FreeRADIUS on Ubuntu Server Latest.
Before we begin the installation process, there are a few prerequisites you’ll need to have in place.
Before we begin installing any software, it’s always a good idea to update and upgrade the Ubuntu server to ensure that all the system packages and dependencies are up-to-date.
sudo apt update && sudo apt upgrade -y
Once the server is up-to-date, we can proceed to install FreeRADIUS by running the following command:
sudo apt install freeradius freeradius-mysql
During the installation process, you’ll be prompted to select a backend database. For this tutorial, we’ll be using MySQL. Enter the MySQL root password when prompted and proceed with the installation.
After installing the MySQL database, we need to create a database for FreeRADIUS to use. To do this, log in to the MySQL server with the following command:
sudo mysql -u root -p
Enter the root password when prompted and then run the following commands:
CREATE DATABASE radius;
GRANT ALL ON radius.* TO 'radius'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit;
This will create a new database called “radius” and a new user called “radius” with the password “password”. You can replace these values with your own if you prefer.
Now that we’ve installed FreeRADIUS and set up the MySQL database, we need to configure FreeRADIUS to use the database. To do this, we’ll need to edit the configuration file with the following command:
sudo nano /etc/freeradius/3.0/mods-available/sql
Locate the following section within the file:
sql {
# The dialect that you want to use
#
# If you want to know what dialects are available, take a look at the
# output of the "raddb/mods-config/sql/main/*/queries.conf" files.
#
dialect = "mysql"
Update the following lines to match your MySQL credentials:
server = "localhost"
port = 3306
login = "radius"
password = "password"
radius_db = "radius"
Once finished, save the file and exit the editor.
Next, create a symbolic link from the mods-available directory to the mods-enabled directory with the following command:
sudo ln -s /etc/freeradius/3.0/mods-available/sql /etc/freeradius/3.0/mods-enabled/
To ensure that all changes take effect, we need to restart the FreeRADIUS service with the following command:
sudo systemctl restart freeradius
To verify that FreeRADIUS is working properly, we’ll run a test command to create a new user in our MySQL database. Run the following command:
sudo radiusd -X
This will start FreeRADIUS in debug mode, which will output any errors or information about the server to the console. Once the server has started, open a new terminal session and run the following command:
radtest testuser testpassword localhost 0 testing123
This command will attempt to authenticate the user “testuser” with the password “testpassword” using the FreeRADIUS server running on localhost. You should see a response from the server, indicating whether the authentication was successful or not.
Once you’ve verified that the server is functioning properly, press Ctrl+C to stop the debug output.
Congratulations! You’ve successfully installed and configured FreeRADIUS on your Ubuntu server. Now that you’ve got the basics down, you can start exploring some of the advanced features that FreeRADIUS has to offer!
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!