Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
|
f11:technik:raspberrypi:hotspotdm3kb:raspeasyhpdb [2014/12/05 08:02] dm3kb |
f11:technik:raspberrypi:hotspotdm3kb:raspeasyhpdb [2019/09/29 12:03] (aktuell) |
||
|---|---|---|---|
| Zeile 5: | Zeile 5: | ||
| < | < | ||
| echo " | echo " | ||
| - | Enter password: | + | Enter password: |
| </ | </ | ||
| Zeile 12: | Zeile 12: | ||
| < | < | ||
| mysql -u root -p | mysql -u root -p | ||
| - | Enter password: | + | Enter password: |
| mysql> create database easyhpradiusdb; | mysql> create database easyhpradiusdb; | ||
| mysql> quit; | mysql> quit; | ||
| Zeile 25: | Zeile 25: | ||
| Easyhotspot database, username and password system/ | Easyhotspot database, username and password system/ | ||
| + | |||
| Zeile 31: | Zeile 32: | ||
| < | < | ||
| mysql -u root -p easyhpradiusdb < / | mysql -u root -p easyhpradiusdb < / | ||
| - | Enter password: | + | Enter password: |
| </ | </ | ||
| **Note: The script: / | **Note: The script: / | ||
| - | |||
| Zeile 61: | Zeile 61: | ||
| </ | </ | ||
| - | == Get Easy-Hotspot Files === | ||
| - | Download easyhotspot web from https:// | ||
| - | < | ||
| - | cd /opt | ||
| - | git clone https:// | ||
| - | </ | ||
| Erase all Radius information from " | Erase all Radius information from " | ||
| create the tables needed for EASY-Hotspot.\\ | create the tables needed for EASY-Hotspot.\\ | ||
| + | ehs_noraddata_0.2p3.sql can be found in: / | ||
| + | Copy it to e.g. database_HP-only-NoRadius-NoData.sql | ||
| + | and use vi to earse all radius related operations\\ | ||
| + | \\ | ||
| + | Then use this file to create the EASY-Hotspot tables in the same DB that already contain the FreeRadius tabels.\\ | ||
| + | \\ | ||
| < | < | ||
| - | root@raspberrypi: | + | root@raspberrypi: |
| - | Enter password: | + | Enter password: |
| </ | </ | ||
| ==Check tables== | ==Check tables== | ||
| - | + | Check what tables have been created: | |
| < | < | ||
| mysql -u root -p easyhpradiusdb | mysql -u root -p easyhpradiusdb | ||
| - | Enter password: | + | Enter password:??? |
| Zeile 121: | Zeile 119: | ||
| ==Set DB-User Permissions== | ==Set DB-User Permissions== | ||
| - | As we skipped Admin.sql no radius user has been created. To split responsibilities, | + | As we skipped |
| - | Note: First it is explained step by step a bit below all commands are listed as a Copy & paste block!! | + | **Note:** __First |
| - | Start with creating the easyhotspot user: | + | Start with creating the |
| < | < | ||
| mysql -u root -p | mysql -u root -p | ||
| - | Enter password: | + | Enter password: |
| mysql> | mysql> | ||
| Zeile 154: | Zeile 152: | ||
| # Change PW for easyhotspot | # Change PW for easyhotspot | ||
| - | ##### | + | ##### |
| - | mysql> UPDATE mysql.user SET Password=PASSWORD(' | + | mysql> UPDATE mysql.user SET Password=PASSWORD(' |
| Query OK, 1 row affected (0.01 sec) | Query OK, 1 row affected (0.01 sec) | ||
| Rows matched: 1 Changed: 1 Warnings: 0 | Rows matched: 1 Changed: 1 Warnings: 0 | ||
| Zeile 163: | Zeile 161: | ||
| # Change PW for radius | # Change PW for radius | ||
| - | ##### | + | ##### |
| - | mysql> UPDATE mysql.user SET Password=PASSWORD(' | + | mysql> UPDATE mysql.user SET Password=PASSWORD(' |
| Query OK, 1 row affected (0.01 sec) | Query OK, 1 row affected (0.01 sec) | ||
| Rows matched: 1 Changed: 1 Warnings: 0 | Rows matched: 1 Changed: 1 Warnings: 0 | ||
| Zeile 175: | Zeile 173: | ||
| # Grant usage for easyhotspot | # Grant usage for easyhotspot | ||
| - | mysql> GRANT ALL ON easyhpradiusdb . * TO ' | + | mysql> GRANT ALL ON easyhpradiusdb . * TO ' |
| Query OK, 0 rows affected (0.01 sec) | Query OK, 0 rows affected (0.01 sec) | ||
| mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
| - | mysql> GRANT SELECT ON easyhpradiusdb . radcheck TO ' | + | # Grant usage for radius |
| + | mysql> GRANT SELECT ON easyhpradiusdb . radcheck TO ' | ||
| Query OK, 0 rows affected (0.01 sec) | Query OK, 0 rows affected (0.01 sec) | ||
| mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
| - | mysql> GRANT SELECT ON easyhpradiusdb . radgroupcheck TO ' | + | mysql> GRANT SELECT ON easyhpradiusdb . radgroupcheck TO ' |
| Query OK, 0 rows affected (0.01 sec) | Query OK, 0 rows affected (0.01 sec) | ||
| mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
| - | mysql> GRANT SELECT ON easyhpradiusdb . radreply TO ' | + | mysql> GRANT SELECT ON easyhpradiusdb . radreply TO ' |
| Query OK, 0 rows affected (0.01 sec) | Query OK, 0 rows affected (0.01 sec) | ||
| mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
| - | mysql> GRANT SELECT ON easyhpradiusdb . radgroupreply TO ' | + | mysql> GRANT SELECT ON easyhpradiusdb . radgroupreply TO ' |
| Query OK, 0 rows affected (0.01 sec) | Query OK, 0 rows affected (0.01 sec) | ||
| mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
| - | mysql> GRANT ALL ON easyhpradiusdb . radacct TO ' | + | mysql> GRANT ALL ON easyhpradiusdb . radacct TO ' |
| Query OK, 0 rows affected (0.01 sec) | Query OK, 0 rows affected (0.01 sec) | ||
| mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
| - | mysql> GRANT ALL ON easyhpradiusdb . radpostauth TO ' | + | mysql> GRANT ALL ON easyhpradiusdb . radpostauth TO ' |
| Query OK, 0 rows affected (0.01 sec) | Query OK, 0 rows affected (0.01 sec) | ||
| mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
| - | mysql> GRANT SELECT ON easyhpradiusdb . radusergroup TO ' | + | mysql> GRANT SELECT ON easyhpradiusdb . radusergroup TO ' |
| Query OK, 0 rows affected (0.01 sec) | Query OK, 0 rows affected (0.01 sec) | ||
| mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
| Zeile 214: | Zeile 213: | ||
| < | < | ||
| mysql -u root -p | mysql -u root -p | ||
| - | Enter password: | + | Enter password: |
| CREATE USER ' | CREATE USER ' | ||
| Zeile 224: | Zeile 223: | ||
| # Change PW for easyhotspot | # Change PW for easyhotspot | ||
| - | ####SET PASSWORD FOR ' | + | ####SET PASSWORD FOR ' |
| UPDATE mysql.user SET Password=PASSWORD(' | UPDATE mysql.user SET Password=PASSWORD(' | ||
| FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| Zeile 230: | Zeile 229: | ||
| # Change PW for radius | # Change PW for radius | ||
| - | #####SET PASSWORD FOR ' | + | #####SET PASSWORD FOR ' |
| UPDATE mysql.user SET Password=PASSWORD(' | UPDATE mysql.user SET Password=PASSWORD(' | ||
| mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
| Zeile 238: | Zeile 237: | ||
| # Grant usage for easyhotspot | # Grant usage for easyhotspot | ||
| - | GRANT ALL ON easyhpradiusdb . * TO ' | + | GRANT ALL ON easyhpradiusdb . * TO ' |
| FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| + | # Grant usage for radius | ||
| - | GRANT SELECT ON easyhpradiusdb . radcheck TO ' | + | GRANT SELECT ON easyhpradiusdb . radcheck TO ' |
| FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| - | GRANT SELECT ON easyhpradiusdb . radgroupcheck TO ' | + | GRANT SELECT ON easyhpradiusdb . radgroupcheck TO ' |
| FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| - | GRANT SELECT ON easyhpradiusdb . radreply TO ' | + | GRANT SELECT ON easyhpradiusdb . radreply TO ' |
| FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| - | GRANT SELECT ON easyhpradiusdb . radgroupreply TO ' | + | GRANT SELECT ON easyhpradiusdb . radgroupreply TO ' |
| FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| - | GRANT ALL ON easyhpradiusdb . radacct TO ' | + | GRANT ALL ON easyhpradiusdb . radacct TO ' |
| FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| - | GRANT ALL ON easyhpradiusdb . radpostauth TO ' | + | GRANT ALL ON easyhpradiusdb . radpostauth TO ' |
| FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| - | GRANT SELECT ON easyhpradiusdb . radusergroup TO ' | + | GRANT SELECT ON easyhpradiusdb . radusergroup TO ' |
| FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| </ | </ | ||
| + | |||
| == Test " | == Test " | ||
| + | Test on commandline that the new user is able to login to DB | ||
| < | < | ||
| mysql -u easyhotspot -p easyhpradiusdb | mysql -u easyhotspot -p easyhpradiusdb | ||
| Zeile 273: | Zeile 275: | ||
| == Test " | == Test " | ||
| + | Test on commandline that the new user is able to login to DB | ||
| < | < | ||
| mysql -u radius -p easyhpradiusdb | mysql -u radius -p easyhpradiusdb | ||
| Zeile 280: | Zeile 283: | ||
| ==Create a user to test radius login== | ==Create a user to test radius login== | ||
| + | <del> | ||
| + | This user is not managed via Easy-Hotspot, | ||
| - | This user is not managed via Easy-Hotspot, | ||
| < | < | ||
| - | echo " | + | echo " |
| </ | </ | ||
| - | Check new user entry in table radcheck | + | <del>Check new user entry in table radcheck\\</ |
| < | < | ||
| mysql> select * from radcheck where username=' | mysql> select * from radcheck where username=' | ||
| Zeile 292: | Zeile 296: | ||
| | id | username | attribute | | id | username | attribute | ||
| +----+----------+--------------------+----+-----------+ | +----+----------+--------------------+----+-----------+ | ||
| - | | 1 | user1 | Cleartext-Password | := | passwd123 | + | | 1 | user1 | Cleartext-Password | := | passwd1 |
| +----+----------+--------------------+----+-----------+ | +----+----------+--------------------+----+-----------+ | ||
| 1 row in set (0.01 sec) | 1 row in set (0.01 sec) | ||
| Zeile 298: | Zeile 302: | ||
| + | ==Create User via EasyHP Admin GUI== | ||
| - | ==Check / Change Freeradius shared secret == | + | Log in to: |
| + | for the first tests. | ||
| + | |||
| + | |||
| + | ==Check / Change Freeradius shared secret== | ||
| Default is " | Default is " | ||
| In case of using a different secret change password, as we have configured above of radius user in mysql, change secret in Free-Radius config. | In case of using a different secret change password, as we have configured above of radius user in mysql, change secret in Free-Radius config. | ||
| Zeile 310: | Zeile 319: | ||
| #port = 3306 | #port = 3306 | ||
| login = " | login = " | ||
| - | password = "Radpass12345 | + | password = "Radpass |
| | | ||
| # Database table configuration for everything except Oracle | # Database table configuration for everything except Oracle | ||
| Zeile 320: | Zeile 329: | ||
| + | ===Test Radius Server=== | ||
| + | Now the Radius Server can be tested as a valid user is available.\\ | ||
| + | Start Radius in Debug-Mode: | ||
| + | < | ||
| + | freeradius -X | ||
| + | </ | ||
| + | Dont panic, tons of output will run over the screen, but important is that after some time \\ | ||
| + | a line named: **Ready to process requests.** is displayed\\ | ||
| + | Now login on another terminal and test radius communication with MySQL by requesting login-In for for the user just created via [[f11: | ||
| + | < | ||
| + | root@raspberrypi: | ||
| + | Sending Access-Request of id 35 to 127.0.0.1 port 1812 | ||
| + | User-Name = " | ||
| + | User-Password = " | ||
| + | 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=35, length=20 | ||
| + | root@raspberrypi: | ||
| + | </ | ||
| + | If you see the reply from Radius that an Access-Accept packet is received the Radius is operational. | ||
| Zeile 326: | Zeile 356: | ||
| - | Additional: Only if something went wrong and a restart is necessary: Drop DB and User: | + | **Additional:** Only if something went wrong and a restart is necessary: Drop DB and User: |
| < | < | ||
| Zeile 343: | Zeile 373: | ||
| mysql> drop database easyhpradiusdb; | mysql> drop database easyhpradiusdb; | ||
| Query OK, 25 rows affected (0.41 sec) | Query OK, 25 rows affected (0.41 sec) | ||
| + | </ | ||
| + | |||
| + | |||
| </ | </ | ||
