skip to Main Content

Trying to install freeradius package on Debian 10 buster and it fails.

$ sudo apt install freeradius
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  freeradius-krb5 freeradius-ldap freeradius-mysql freeradius-postgresql freeradius-python3
The following NEW packages will be installed:
  freeradius
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 555 kB of archives.
After this operation, 2230 kB of additional disk space will be used.
Get:1 http://ftp.de.debian.org/debian sid/main amd64 freeradius amd64 3.0.21+dfsg-2+b2 [555 kB]
Fetched 555 kB in 0s (2753 kB/s)
Selecting previously unselected package freeradius.
(Reading database ... 140557 files and directories currently installed.)
Preparing to unpack .../freeradius_3.0.21+dfsg-2+b2_amd64.deb ...
Unpacking freeradius (3.0.21+dfsg-2+b2) ...
Setting up freeradius (3.0.21+dfsg-2+b2) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
install: invalid user ‘freerad’
dpkg: error processing package freeradius (--configure):
 installed freeradius package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 freeradius
E: Sub-process /usr/bin/dpkg returned an error code (1)

install: invalid user ‘freerad’

Apparently it seems as if there’s something wrong with the freerad user which doesn’t exist?

Typing / checking inside /etc/passwd file learly shows there’s no such user

$ cat /etc/passwd | grep freer*

Checking the syslog shows:

Feb 10 00:38:45 server-1 systemd[1]: freeradius.service: Scheduled restart job, restart counter is at 277.
Feb 10 00:38:45 server-1 freeradius[10918]: FreeRADIUS Version 3.0.21
Feb 10 00:38:45 server-1 freeradius[10918]: Copyright (C) 1999-2019 The FreeRADIUS server project and contributors
Feb 10 00:38:45 server-1 freeradius[10918]: There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
Feb 10 00:38:45 server-1 freeradius[10918]: PARTICULAR PURPOSE
Feb 10 00:38:45 server-1 freeradius[10918]: You may redistribute copies of FreeRADIUS under the terms of the
Feb 10 00:38:45 server-1 freeradius[10918]: GNU General Public License
Feb 10 00:38:45 server-1 freeradius[10918]: For more information about these matters, see the file named COPYRIGHT
Feb 10 00:38:45 server-1 freeradius[10918]: Errors reading /etc/freeradius/3.0: Permission denied
Feb 10 00:38:45 server-1 systemd[1]: freeradius.service: Control process exited, code=exited, status=1/FAILURE
Feb 10 00:38:45 server-1 systemd[1]: freeradius.service: Failed with result 'exit-code'.

Tried a**smarting this by adding the user manually with the command adduser freeradius
and then tried re-installing:

$ sudo apt install freeradius
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
freeradius is already the newest version (3.0.21+dfsg-2+b2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up freeradius (3.0.21+dfsg-2+b2) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
chown: cannot access '/etc/freeradius': No such file or directory
dpkg: error processing package freeradius (--configure):
 installed freeradius package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 freeradius
E: Sub-process /usr/bin/dpkg returned an error code (1)

now it fails prompting a new error: chown: cannot access ‘/etc/freeradius’: No such file or directory

Tried purging / removing / clean / cache deleting / rebooting and then restarting the installation but it keeps reappearing.

Let me know if there’s more info I can provide in manner to help you help me.

Cheers.

2

Answers


  1. After installation of freeradius, add the following lines at the end of the client.conf file to set the access of your client:

        #vi /etc/freeradius/3.0/clients.conf
    

    For Example :

    client SWITCH-01 {
    
    ipaddr = 192.168.0.10
    
    secret = kamisama123
    
    }
    
    
    client LINUX-01 {
    
    ipaddr = 192.168.0.20
    
    secret = vegeto123
    
    }
    

    In our example, we are adding 2 client devices, both devices will offer a login promt to authenticate on freeradius server database.

    Now, locate and edit the freeradius users configuration file:

    Example:

        # vi /etc/freeradius/3.0/users
    

    Adding Your Username And Password Like below:

        freerad1 Cleartext-Password := "freerad1234"
        freerad2 Cleartext-Password := "freerad2123"
    

    Now, Restart freeradius server :

        # service freeradius restart
    

    Now, test your radius server configuration file :

        #freeradius -CX
    

    you can Test your radius authentication locally on the Radius server using the following commands:

        # radtest freerad1 freerad1234 localhost 0 testing123
    

    Here is an example of a successful radius authentication:

    Sent Access-Request Id 151 from 0.0.0.0:34857 to 127.0.0.1:1812 length 75
    User-Name = "freerad1"
    User-Password = "freerad1234"
    NAS-IP-Address = 172.31.41.98
    NAS-Port = 0
    Message-Authenticator = 0x00
    Cleartext-Password = "freerad1234"
    Received Access-Accept Id 151 from 127.0.0.1:1812 to 0.0.0.0:0 length 20
    

    We are using the freerad1 username and the freerad1234 password to authenticate the user account.

    The testing123 is a default device password included in the clients.conf file.

    Now, go to the Linux server included on the clients.conf configuration file as LINUX-01.

    Install the freeradius-utils package.

        # apt-get install freeradius-utils
    

    Test your radius authentication remotely on the Linux server (LINUX-01 OR YOUR CLIENT YOU ARE ADDED ON client.conf) using the following commands:

        # radtest freerad freerad1234 192.168.0.50 0  vegeto123
    

    ** Congratulations, Your Freeradius server is on the service **

    Login or Signup to reply.
  2. when removing freeradius (either by apt remove freeradius or apt purge freeradius) mind that config files are a seperate package called freeradius-config

    so to completely wipe freeradius and do a reinstall do:

    apt purge freeradius freeradius-config
    rm -rf /etc/freeradius/
    apt install freeradius
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search