当前位置:   article > 正文

centos7.x openvpn+freeradius认证daloradius管理

daloradius

继上一篇的openvpn账号密码验证,由于账号密码保存在服务器文件中的是明文,存在一定的风险,现在通过freeradius进行账号认证

同样参考相关网络资料

http://www.beijinghuayu.com.cn/centos7%e9%85%8d%e7%bd%aedaloradius/

freeradius 2.2.5版本限制用户并发登录_norhtlander的专栏-CSDN博客

FreeRADIUS 3.0安装配置_cluniquecui的专栏-CSDN博客

软件版本

freeradius-3.0.13-15.el7.x86_64

mariadb-server-5.5.68-1.el7.x86_64

php-5.4.16-48.el7.x86_64

服务器:阿里云

1.安装

yum安装简便快捷

安装依赖

yum install wget telnet net-tools httpd mariadb-server php php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel epel-release -y

安装freeradius

yum install freeradius freeradius-mysql freeradius-utils -y

2.关闭selinux

  1. [root@openvpn ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
  2. [root@openvpn ~]# setenforce 0
  3. setenforce: SELinux is disabled
  4. [root@openvpn ~]# geten
  5. getenforce getent
  6. [root@openvpn ~]# getenforce
  7. Disabled

3.启动数据库、httpd,关闭防火墙

  1. [root@openvpn ~]# systemctl restart mariadb
  2. [root@openvpn ~]# systemctl restart httpd
  3. [root@openvpn ~]# systemctl stop firewalld
  4. [root@openvpn ~]# systemctl disable firewalld

4.登录数据库,创建radius数据库

  1. [root@openvpn ~]# mysql #默认初次启动的mariadb没有密码,直接登录
  2. Welcome to the MariaDB monitor. Commands end with ; or \g.
  3. Your MariaDB connection id is 3
  4. Server version: 5.5.68-MariaDB MariaDB Server
  5. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
  6. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  7. #设置mariadb的root登录密码
  8. MariaDB [(none)]> set password=password('password');
  9. Query OK, 0 rows affected (0.00 sec)
  10. #创建radius数据库
  11. MariaDB [(none)]> create database radius;
  12. Query OK, 1 row affected (0.00 sec)
  13. #给radius库建用户密码
  14. MariaDB [(none)]> grant all on radius.* to radius@localhost identified by 'radius';
  15. Query OK, 0 rows affected (0.00 sec)
  16. #刷新
  17. MariaDB [(none)]> flush privileges;
  18. Query OK, 0 rows affected (0.01 sec)
  19. #退出
  20. MariaDB [(none)]> quit
  21. Bye

5.初始化freeradius数据库

  1. [root@openvpn ~]# cd /etc/raddb/
  2. [root@openvpn raddb]# ls
  3. certs hints mods-config policy.d README.rst templates.conf
  4. clients.conf huntgroups mods-enabled proxy.conf sites-available trigger.conf
  5. dictionary mods-available panic.gdb radiusd.conf sites-enabled users

yum安装的freeradius配置文件默认在/etc/raddb

  1. #初始化数据库
  2. [root@openvpn mysql]# mysql -uradius -p radius < schema.sql
  3. Enter password:
  4. [root@openvpn mysql]# mysql -uradius -p radius
  5. Enter password:
  6. Reading table information for completion of table and column names
  7. You can turn off this feature to get a quicker startup with -A
  8. Welcome to the MariaDB monitor. Commands end with ; or \g.
  9. Your MariaDB connection id is 6
  10. Server version: 5.5.68-MariaDB MariaDB Server
  11. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
  12. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  13. MariaDB [radius]> use radius
  14. Database changed
  15. MariaDB [radius]> show tables;
  16. +------------------+
  17. | Tables_in_radius |
  18. +------------------+
  19. | nas |
  20. | radacct |
  21. | radcheck
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/943465
推荐阅读
相关标签
  

闽ICP备14008679号