Username OR Serial Number

Matthew Newton mcn4 at
Tue Nov 29 17:33:31 CET 2016

On Tue, Nov 29, 2016 at 11:16:56AM -0500, David Teston wrote:
> >  I guess you've got somewhere a record with a serial number, password and
> optional user name.
> For testing, I'm copying credentials from an application we use/host which
> does include all of those.

Your simplest solution may then be to just create two identical
entries in your SQL database for each set of credentials. One with
username = the username, and the other with username = serial

That will keep your FreeRADIUS config much simpler.

> User logs in with serial: User-Name = "987688113"
> The new SQL query could be: SELECT id, UserName, Attribute, Value, Op FROM
> radcheck WHERE (Username = '987688113' OR serial = '987688113') ORDER BY id;

The SQL statements can all be modified, so you should be able to
do something with it along these lines.

But breaking it down to its simplest, one person can log in with
two accounts. So put two accounts in the database.

Otherwise, use unlang to work out what type of username is being
used, and depending on that call the appropriate sql module, or
use the appropriate sql statements.


Matthew Newton, Ph.D. <mcn4 at>

Systems Specialist, Infrastructure Services,
I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom

For IT help contact helpdesk extn. 2253, <ithelp at>

More information about the Freeradius-Users mailing list