当前位置: 首页 > 工具软件 > GNU Radius > 使用案例 >

在centos7上安装freeradius

叶鸿
2023-12-01

在centos7上安装freeradius

1. yum安装

yum install freeradius

2. 编译安装

获取最新的稳定版本:

官网下载地址https://freeradius.org/releases/或者https://freeradius.org/ftp/pub/freeradius/

先安装依赖 libtalloc-devel

yum -y install libtalloc-devel

解压freeradius-server-3.0.21.tar.gz

tar -vxf freeradius-server-3.0.21.tar.gz
cd freeradius-server-3.0.21/
./configure
make
sudo make install

如果遇到

checking for perl... /usr/bin/perl
checking for snmpget... no
configure: WARNING: snmpget not found - Simultaneous-Use and checkrad may not work
checking for snmpwalk... no
configure: WARNING: snmpwalk not found - Simultaneous-Use and checkrad may not work
checking for rusers... /usr/bin/rusers
/opt/vsftp/he/freeradius-server-3.0.12/missing: Unknown `--is-lightweight' option
Try `/opt/vsftp/he/freeradius-server-3.0.12/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for locate... /usr/bin/locate
checking for dirname... /usr/bin/dirname
checking for grep... (cached) /usr/bin/grep
checking for _talloc in -ltalloc... no
checking for _talloc in -ltalloc in /usr/lib64... no
checking for _talloc in -ltalloc in /usr/lib64/samba... no
checking for _talloc in -ltalloc in /usr/local/lib... no
checking for _talloc in -ltalloc in /opt/lib... no
configure: WARNING: talloc library not found. Use --with-talloc-lib-dir=<path>.
configure: error: FreeRADIUS requires libtalloc

解决办法:

安装libtalloc-devel:
yum install -y libtalloc-devel

问题解决,再次./configure,没有再打印这个错误信息,说明这个问题解决,而是打印了下一个错误信息:

checking for utmpx.h... yes
checking winsock.h usability... no
checking winsock.h presence... no
checking for winsock.h... no
checking for net/if.h... yes
checking for DH_new in -lcrypto... no
checking for DH_new in -lcrypto in /usr/lib64... no
checking for DH_new in -lcrypto in /usr/local/lib... no
checking for DH_new in -lcrypto in /opt/lib... no
configure: error: in `/opt/vsftp/he/freeradius-server-3.0.12':
configure: error: failed linking to libcrypto. Use --with-openssl-lib-dir=<path>, or --with-openssl=no (builds without OpenSSL)
See `config.log' for more details
[root@fedora freeradius-server-3.0.12]#

错误信息显示链接不到libcrypto

执行 rpm -qa |grep libcrypto
查看有没有返回信息,没有返回就是没有安装。
libcrypto包含在openssl安装包里,OpenSSL 包含2个主要的库: libssllibcrypto.

解决办法就是安装openssl:

yum install openssl openssl-devel

运行./configure显示这个问题解决,并且没有报其它错误信息

至此,./configure执行成功

接下来执行make命令

如果遇到error: efusing to start with libssl version OpenSSL , 进入etc/raddb下找到radiusd.confallow_vulnerable_openssl = no 修改为allow_vulnerable_openssl = yes即可。

查看版本:

radiusd -v

[root@centos7 freeradius-server-3.0.21]# radiusd -v
radiusd: FreeRADIUS Version 3.0.21, for host x86_64-unknown-linux-gnu, built on Jan  3 2021 at 21:05:06
FreeRADIUS Version 3.0.21
Copyright (C) 1999-2019 The FreeRADIUS server project and contributors
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE
You may redistribute copies of FreeRADIUS under the terms of the
GNU General Public License
For more information about these matters, see the file named COPYRIGHT
[root@aliy-ecs-centos7 freeradius-server-3.0.21]# 

安装成功

client配置文件位置:/usr/local/etc/raddb/clients.conf

user配置文件位置: /usr/local/etc/raddb/users

default文件位置:/usr/local/etc/raddb/sites-enabled/default

 类似资料: