1

I am trying to use the following at the top of my files authorize to test a new radius installation on default configs.

head /etc/raddb/mods-config/files/authorize
bob Cleartext-Password := "hello"
    Reply-Message := "Hello, %{User-Name}"

test    Cleartext-Password := "test"
    Reply-Message := "Hello, %{User-Name}


#
#   Configuration file for the rlm_files module.
#   Please see rlm_files(5) manpage for more information.

This fails to load at start up. With the last few lines of the logs looking like this.

/sbin/radiusd -f -X -x
.....
Wed Aug 16 16:37:38 2017 : Debug:       reference = "Accounting-Request.%{%{Acct-Status-Type}:-unknown}"
Wed Aug 16 16:37:38 2017 : Debug:   }
Wed Aug 16 16:37:38 2017 : Debug:     (Loaded rlm_files, checking if it's valid)
Wed Aug 16 16:37:38 2017 : Debug:   # Loaded module rlm_files
Wed Aug 16 16:37:38 2017 : Debug:   # Instantiating module "files" from file /etc/raddb/mods-enabled/files
Wed Aug 16 16:37:38 2017 : Debug:   files {
Wed Aug 16 16:37:38 2017 : Debug:       filename = "/etc/raddb/mods-config/files/authorize"
Wed Aug 16 16:37:38 2017 : Debug:       usersfile = "/etc/raddb/mods-config/files/authorize"
Wed Aug 16 16:37:38 2017 : Debug:       acctusersfile = "/etc/raddb/mods-config/files/accounting"
Wed Aug 16 16:37:38 2017 : Debug:       preproxy_usersfile = "/etc/raddb/mods-config/files/pre-proxy"
Wed Aug 16 16:37:38 2017 : Debug:       compat = "cistron"
Wed Aug 16 16:37:38 2017 : Debug:   }
Wed Aug 16 16:37:38 2017 : Debug: reading pairlist file /etc/raddb/mods-config/files/authorize
Wed Aug 16 16:37:38 2017 : Error: /etc/raddb/mods-config/files/authorize[5]: Parse error (reply) for entry test: Expected end of line or comma
Wed Aug 16 16:37:38 2017 : Error: Failed reading /etc/raddb/mods-config/files/authorize
Wed Aug 16 16:37:38 2017 : Error: /etc/raddb/mods-enabled/files[9]: Instantiation failed for module "files"
nelaaro
  • 1,333
  • 3
  • 15
  • 20

1 Answers1

3

After many hours and a lot of googling.
I fixed this by taking a harder look at the lines in my authorise

bob Cleartext-Password := "hello"
    Reply-Message := "Hello, %{User-Name}"

test    Cleartext-Password := "test"
    Reply-Message := "Hello, %{User-Name}

The problem was the trailing " was missing on my test user.
Googling for the error did not get me to any useful answers.

Error: /etc/raddb/mods-config/files/authorize[5]: Parse error (reply) for entry test: Expected end of line or comma

I just added the missing " after %{User-Name}" and everything worked.

test    Cleartext-Password := "test"
    Reply-Message := "Hello, %{User-Name}"

I hope this save somebody some time in the future.

$ radtest "test" test 127.0.0.1 1812  testing123
Sent Access-Request Id 25 from 0.0.0.0:59986 to 127.0.0.1:1812 length 74
    User-Name = "test"
    User-Password = "test"
    NAS-IP-Address = 127.0.1.1
    NAS-Port = 1812
    Message-Authenticator = 0x00
    Cleartext-Password = "test"
Received Access-Accept Id 25 from 127.0.0.1:1812 to 0.0.0.0:0 length 33
    Reply-Message = "Hello, test"
nelaaro
  • 1,333
  • 3
  • 15
  • 20