How to Install FreeRADIUS on Ubuntu Server Latest

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.

Prerequisites

Before we begin the installation process, there are a few prerequisites you’ll need to have in place.

  1. An Ubuntu server with sudo privileges
  2. An internet connection
  3. Access to the terminal/command-line interface

Step 1 — Update the Ubuntu Server

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

Step 2 — Install FreeRADIUS

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.

Step 3 — Configure the MySQL Database

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.

Step 4 — Configure FreeRADIUS

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/

Step 5 — Restart FreeRADIUS

To ensure that all changes take effect, we need to restart the FreeRADIUS service with the following command:

sudo systemctl restart freeradius

Step 6 — Verify the Installation

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.

Conclusion

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!