Created
July 13, 2021 17:51
-
-
Save afahitech/ca40c394cf179380e9b97d7e70445d7e to your computer and use it in GitHub Desktop.
How to install FreeRadius in Ubuntu 20.04LTS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
apt-get update -y | |
apt-get upgrade -y | |
#Install Apache | |
sudo apt-get install apache2 | |
#Install PHP | |
sudo apt-get install php libapache2-mod-php php-gd php-common php-mail php-mail-mime php-mysql php-pear php-db php-mbstring php-xml php-curl | |
#Install MariaDB | |
sudo apt -y install mariadb-server mariadb-client | |
#Configure Database for FreeRADIUS | |
mysql_secure_installation | |
mysql -u root -p | |
CREATE DATABASE radius CHARACTER SET UTF8 COLLATE UTF8_BIN; | |
CREATE USER 'radius'@'%' IDENTIFIED BY 'Falaq1234#'; | |
GRANT ALL PRIVILEGES ON radius.* TO 'radius'@'%'; | |
QUIT; | |
#Install FreeRADIUS | |
sudo apt policy freeradius | |
sudo apt -y install freeradius freeradius-mysql freeradius-utils | |
#Once installed, import the freeradius MySQL database schema with the following command: | |
sudo su - | |
mysql -u root -p radius < /etc/freeradius/3.0/mods-config/sql/main/mysql/schema.sql | |
sudo mysql -u root -p -e "use radius;show tables;" | |
#Create a soft link for sql module under | |
sudo ln -s /etc/freeradius/3.0/mods-available/sql /etc/freeradius/3.0/mods-enabled/ | |
#Set the proper permission | |
sudo chgrp -h freerad /etc/freeradius/3.0/mods-available/sql | |
sudo chown -R freerad:freerad /etc/freeradius/3.0/mods-enabled/sql | |
systemctl restart freeradius | |
systemctl status freeradius | |
#Install daloRADIUS | |
sudo apt -y install wget unzip | |
wget https://github.com/lirantal/daloradius/archive/master.zip | |
unzip master.zip | |
mv daloradius-master daloradius | |
#Configuring daloradius | |
sudo mysql -u root -p radius < contrib/db/fr2-mysql-daloradius-and-freeradius.sql | |
sudo mysql -u root -p radius < contrib/db/mysql-daloradius.sql | |
cd .. | |
sudo mv daloradius /var/www/html/ | |
sudo chown -R www-data:www-data /var/www/html/daloradius/ | |
sudo chmod 664 /var/www/html/daloradius/library/daloradius.conf.php.sample | |
#Make the following changes that match your database: | |
nano /var/www/html/daloradius/library/daloradius.conf.php.sample | |
$configValues['CONFIG_DB_HOST'] = 'localhost'; | |
$configValues['CONFIG_DB_PORT'] = '3306'; | |
$configValues['CONFIG_DB_USER'] = 'radius'; | |
$configValues['CONFIG_DB_PASS'] = 'Str0ngR@diusPass'; | |
$configValues['CONFIG_DB_NAME'] = 'radius'; | |
sudo systemctl restart freeradius.service apache2 | |
#Visit: | |
http://localhost/daloradius/login.php | |
Username: administrator | |
Password: radius |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment