FreeRADIUS - 当会话已过期时从数据库中删除用户
问题描述:
我正在使用FreeRADIUS以及MySQL来验证用户身份。FreeRADIUS - 当会话已过期时从数据库中删除用户
用户保存在radcheck表中。用户属性保存在radreply表中。
例如,我在radcheck表中有一个名为Bob的用户。
username | attribute | op | value
------------------------------------------------
Bob | Cleartext-Password | := | password12
鲍勃具有在radreply表会话超时值的60(1分钟)。
username | attribute | op | value
------------------------------------------------
Bob | Session-Timeout | := | 60
Bob | Idle-Timeout | := | 60
这一切工作正常。我的问题是RADIUS只是马上重新认证Bob。我认为这是因为Bob仍然存在于radcheck表中。
有没有办法从radcheck和radreply的会话超时时间后表已经达到去除鲍勃?
答
您可以使用Perl/PHP脚本在postacctsql中使用Freeradius中的Perl/PHP模块编写自定义登录。 postacctsql会为您提供会话超时的用户,然后您可以编写自定义脚本以从Mysql DB中删除记录。你可以在谷歌上找到这样的脚本的很多例子。