dongtan1009 2017-07-19 05:36
浏览 380

FreeRADIUS - 会话过期时从数据库中删除用户

I am using FreeRADIUS along with MySQL to authenticate users.

Users are saved in the radcheck table. User attributes are saved in the radreply table.

For example I have a user named Bob in the radcheck table.

username | attribute           | op | value
------------------------------------------------
Bob      | Cleartext-Password  | := | password12

Bob has a Session-Timeout value of 60 (1 minute) in the radreply table.

username | attribute       | op | value
------------------------------------------------
Bob      | Session-Timeout | := | 60
Bob      | Idle-Timeout    | := | 60

This all works fine. My problem is that RADIUS just re-authenticates Bob straight away. I assume this is because Bob still exists in the radcheck table.

Is there a way to remove Bob from the radcheck and radreply tables after the Session-Timeout time has been reached?

  • 写回答

2条回答 默认 最新

  • doudeng5764 2017-09-19 14:53
    关注

    You can write a custom login using Perl/PHP script in postacctsql using Perl/PHP module in Freeradius. postacctsql will give you the user who is session timeout and then you can write a custom script to delete a record from Mysql DB. You can find many examples of such scrip on google.

    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序