Would you like to learn how to configure PostgreSQL Radius authentication using Freeradius? In this tutorial, we are going to show you how to authenticate PostgreSQL users using the Radius protocol and the Freeradius service on a computer running Ubuntu Linux.
• Ubuntu 19.10
• PostgreSQL 12.1
PostgreSQL Related Tutorial:
On this page, we offer quick access to a list of tutorials related to PostgreSQL.
Tutorial – FreeRadius Server Installation on Ubuntu Linux
• IP – 192.168.15.10.
• Operacional System – Ubuntu 19
• Hostname – UBUNTU
On the Linux console, use the following commands to install the FreeRadius service.
Now, we need to add FreeRadius clients to the clients.conf;.
Locate and edit the clients.conf.
Add the following lines at the end of the clients.conf file.
In our example, we are adding 1 client device:
The device was named POSTGRESQL and has the IP address 192.168.15.11.
Now, we need to add FreeRadius users to the USERS configuration file.
Locate and edit the Freeradius users configuration file.
Add the following lines at the end of the file
Restart the Freeradius server.
Test your radius server configuration file.
You have finished the Freeradius installation on Ubuntu Linux.
Tutorial PostgreSQL – Radius Authentication using Freeradius
• IP – 192.168.15.11
• Operacional System – Ubuntu 19
• Hostname – POSTGRESQL
On the Linux console, use the following commands to check your Ubuntu codename.
In our example, Ubuntu 19.10 codename is eoan.
Take note of this information.
On the Linux console, use the following commands to add the PostgreSQL APT repository
Install the PostgreSQL service.
Use the following commands to create a new account named admin.
Here is the command output:
Locate and edit the pg_hba.conf configuration file.
Add the following line at the beginning of this file.
Here is our pg_hba.conf file content:
We performed the following configuration:
• Radius Server IP – 34.221.44.138
• Radius Secret – kamisama123
• Radius Port – 1812
You need to change the IP address to your Freeradius server IP.
You need to change the Raidius secres to your radius password.
Restart the PostgreSQL service.
Connect to the PostgreSQL server using the admin account and the password set on the Active directory.
Here is the command output:
Congratulations! You have configured the PostgreSQL authentication to use a Radius database.