Created
August 12, 2016 08:57
-
-
Save hanafiah/f006e04beeee7177a2543c0bb0c11241 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
pi@raspberrypi:~ $ sudo apt-get install -y debconf-utils | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
debconf-utils is already the newest version. | |
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. | |
pi@raspberrypi:~ $ sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password raspbian' | |
pi@raspberrypi:~ $ sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password raspbian' | |
pi@raspberrypi:~ $ sudo apt-get update | |
pi@raspberrypi:~ $ sudo apt-get install -y debhelper libssl-dev libcurl4-gnutls-dev mysql-server freeradius freeradius-mysql gcc make libnl1 libnl-dev pkg-config iptables | |
#create db | |
echo "create database radius;" | mysql -u root -praspbian | |
pi@raspberrypi:~ $ sudo su - | |
root@raspberrypi:~# mysql -u root -praspbian radius < /etc/freeradius/sql/mysql/schema.sql | |
root@raspberrypi:~# mysql -u root -praspbian radius < /etc/freeradius/sql/mysql/admin.sql | |
root@raspberrypi:~# mysql -u root -praspbian radius < /etc/freeradius/sql/mysql/nas.sql | |
root@raspberrypi:~# nano /etc/freeradius/radiusd.conf | |
#---------------- | |
# Include another file that has the SQL-related configuration. | |
# This is another file only because it tends to be big. | |
# | |
$INCLUDE sql.conf | |
#---------------- | |
root@raspberrypi:~# nano /etc/freeradius/sites-enabled/default | |
#---------------- | |
# buang semua komen yg ada sql | |
# sql | |
#---------------- | |
service freeradius stop | |
freeradius -X | |
#create test user | |
echo "insert into radcheck (username, attribute, op, value) values ('usertest', 'Cleartext-Password', ':=', 'passwd');" | mysql -u root -praspbian radius | |
#test | |
pi@raspberrypi:~ $ radtest usertest passwd localhost 0 testing123 | |
Sending Access-Request of id 163 to 127.0.0.1 port 1812 | |
User-Name = "usertest" | |
User-Password = "passwd" | |
NAS-IP-Address = 127.0.1.1 | |
NAS-Port = 0 | |
Message-Authenticator = 0x00000000000000000000000000000000 | |
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=163, length=20 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment