0

I am using freeradius/mysql/daloradius.

I need my customers to be able to login using a username and password that they signed up with and at the same time give them different access periods.

How do I accomplish that?

I've attempted editing /etc/freeradius/sql/mysql/dialup.conf:

authorize_check_query = "SELECT id, username, password, attribute, value, op \
  FROM ${authcheck_table} \
  WHERE username = '%{SQL-User-Name}'\
  ORDER BY id"
dawud
  • 14,918
  • 3
  • 41
  • 61
philip
  • 1
  • 1

1 Answers1

2

You should use the logintime module, and call it after the SQL module in raddb/sites-available/default authorize{}.

You can then add a row to the radcheck table for the user who's period of access you want to limit, with attribute Login-Time op := and value in the format described here man systems under the Time heading.

The logintime module will reject the user if they are not logging in within an allowed period, and Accept the user, adding the Session-Timeout attribute to force re-authentication when their current allowed access period ends.

Arran Cudbard-Bell
  • 1,514
  • 1
  • 9
  • 18