2

I'm trying to install FreeRadius server locally and test that it's working in the right way. What I did:

  1. downloaded the server (https://wiki.freeradius.org/building/macOS)
  2. unzipped and ran
./configure --enable-developer --with-openssl=no
make
sudo make install
  1. after that I've tried to follow the tutorial (https://wiki.freeradius.org/guide/Basic-configuration-HOWTO) to set up PAP authentication. Basically I've done:
  • I've created a file 'raddb/users' (without any extension)
  • Put inside of 'users' file content
bob Cleartext-Password := "hello"
  • run /build/bin/radiusd -x
  • waited for the 'Read to process requests'
  • executed
radtest bob hello localhost 0 testing123
  • also, I've tried
echo "User-Name=bob,Cleartext-Password=hello" | /usr/local/bin/radclient localhost:1812 auth testing123

# or

echo "User-Name=bob,User-Password=hello" | /usr/local/bin/radclient localhost:1812 auth testing123

So, no matter what I'm trying I'm getting the same result. In console with the command I'm getting:

echo "User-Name=bob,Cleartext-Password=hello" | /usr/local/bin/radclient localhost:1812 auth testing123
Sent Access-Request Id 94 from 0.0.0.0:57710 to 127.0.0.1:1812 length 25
Received Access-Reject Id 94 from 127.0.0.1:1812 to 127.0.0.1:57710 length 20
(0) -: Expected Access-Accept got Access-Reject


radtest bob hello localhost 0 testing123
Sent Access-Request Id 89 from 0.0.0.0:61465 to 127.0.0.1:1812 length 73
    User-Name = "bob"
    User-Password = "hello"
    NAS-IP-Address = 192.168.1.175
    NAS-Port = 0
    Message-Authenticator = 0x00
    Cleartext-Password = "hello"
Received Access-Reject Id 89 from 127.0.0.1:1812 to 127.0.0.1:61465 length 20
(0) -: Expected Access-Accept got Access-Reject

In any case (any command) I will see such logs in the server's console:

(4) Received Access-Request Id 204 from 127.0.0.1:63640 to 127.0.0.1:1812 length 73
(4)   User-Name = "bob"
(4)   User-Password = "hello"
(4)   NAS-IP-Address = 192.168.1.175
(4)   NAS-Port = 0
(4)   Message-Authenticator = 0x248b0163da0492fda522a592111071b8
(4) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default
(4)   authorize {
(4)     policy filter_username {
(4)       if (&User-Name) {
(4)       if (&User-Name)  -> TRUE
(4)       if (&User-Name)  {
(4)         if (&User-Name =~ / /) {
(4)         if (&User-Name =~ / /)  -> FALSE
(4)         if (&User-Name =~ /@[^@]*@/ ) {
(4)         if (&User-Name =~ /@[^@]*@/ )  -> FALSE
(4)         if (&User-Name =~ /\.\./ ) {
(4)         if (&User-Name =~ /\.\./ )  -> FALSE
(4)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))  {
(4)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))   -> FALSE
(4)         if (&User-Name =~ /\.$/)  {
(4)         if (&User-Name =~ /\.$/)   -> FALSE
(4)         if (&User-Name =~ /@\./)  {
(4)         if (&User-Name =~ /@\./)   -> FALSE
(4)       } # if (&User-Name)  = notfound
(4)     } # policy filter_username = notfound
(4)     [preprocess] = ok
(4)     [chap] = noop
(4)     [mschap] = noop
(4)     [digest] = noop
(4) suffix: Checking for suffix after "@"
(4) suffix: No '@' in User-Name = "bob", looking up realm NULL
(4) suffix: No such realm "NULL"
(4)     [suffix] = noop
(4) eap: No EAP-Message, not doing EAP
(4)     [eap] = noop
(4)     [files] = noop
(4)     [expiration] = noop
(4)     [logintime] = noop
(4) pap: WARNING: No "known good" password found for the user.  Not setting Auth-Type
(4) pap: WARNING: Authentication will fail unless a "known good" password is available
(4)     [pap] = noop
(4)   } # authorize = ok
(4) ERROR: No Auth-Type found: rejecting the user via Post-Auth-Type = Reject
(4) Failed to authenticate the user
(4) Using Post-Auth-Type Reject
(4) # Executing group from file /usr/local/etc/raddb/sites-enabled/default
(4)   Post-Auth-Type REJECT {
(4) attr_filter.access_reject: EXPAND %{User-Name}
(4) attr_filter.access_reject:    --> bob
(4) attr_filter.access_reject: Matched entry DEFAULT at line 11
(4)     [attr_filter.access_reject] = updated
(4)     [eap] = noop
(4)     policy remove_reply_message_if_eap {
(4)       if (&reply:EAP-Message && &reply:Reply-Message) {
(4)       if (&reply:EAP-Message && &reply:Reply-Message)  -> FALSE
(4)       else {
(4)         [noop] = noop
(4)       } # else = noop
(4)     } # policy remove_reply_message_if_eap = noop
(4)   } # Post-Auth-Type REJECT = updated
(4) Delaying response for 1.000000 seconds
Waking up in 0.3 seconds.
Waking up in 0.6 seconds.
(4) Sending delayed response
(4) Sent Access-Reject Id 204 from 127.0.0.1:1812 to 127.0.0.1:63640 length 20
Waking up in 3.9 seconds.
(4) Cleaning up request packet ID 204 with timestamp +746
Ready to process requests

I see the warning there

No "known good" password found for the user.

but I can't understand what is the way to provide the password with this command or where should I put 'users' file, or what I should put in it. Can't understand how should I connect to the running server with this 'radtest' or 'radclient' tools. Any help is welcome

andrey
  • 347
  • 3
  • 11

0 Answers0