Hello all, Firstly, my apologies if this is not freeradius related but am hoping someone may have seen this before or could point me in the right direction please: I am trying to connect to an mssql database with freeradius on redhat. When running radiusd -X I am getting the following readout (error): Nov 25 13:40:27 rhmssql1 radiusd[7698]: Creating attribute Unix-Group Nov 25 13:40:27 rhmssql1 radiusd[7698]: Could not link driver rlm_sql_unixodbc: /usr/lib64/freeradius/rlm_sql_unixodbc.so: cannot open shared object file: No such file or directory Nov 25 13:40:27 rhmssql1 radiusd[7698]: Make sure it (and all its dependent libraries!) are in the search path of your system's Nov 25 13:40:27 rhmssql1 radiusd[7698]: /etc/raddb/mods-enabled/sql[27]: Instantiation failed for module "sql" Nov 25 13:40:27 rhmssql1 systemd[1]: radiusd.service: control process exited, code=exited status=1 Nov 25 13:40:27 rhmssql1 systemd[1]: Failed to start FreeRADIUS multi-protocol policy server. -- Subject: Unit radiusd.service has failed I have checked the directory /usr/lib64/freeradius/ and sure enough the file rlm_sql_unixodbc.so does not exist there. I have tested with isql -v rhmssql1 radius radPass_123 and that works fine. I can also access the DB with either radius or SA. I have configured /etc/odbc.ini with the following: [rhmssql1] Driver = ODBC Driver 17 for SQL Server Description=My DSN for the FreeRADIUS Database Database = radius Server = tcp:192.168.56.167,1433 The Driver section in here should then point to the relevant part in odbcinst.ini which is configured as follows: [ODBC Driver 13 for SQL Server] Description=Microsoft ODBC Driver 13 for SQL Server Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.9.2 UsageCount=1 [ODBC Driver 17 for SQL Server] Description=Microsoft ODBC Driver 17 for SQL Server Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.8.so.1.2 UsageCount=1 I have checked the locations as follows: [root@rhmssql1 lib64]# ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.8.so.1.2 linux-vdso.so.1 => (0x00007ffd793f3000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fc7c12fa000) librt.so.1 => /lib64/librt.so.1 (0x00007fc7c10f2000) libodbcinst.so.2 => /lib64/libodbcinst.so.2 (0x00007fc7c0ed8000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007fc7c0bef000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007fc7c09a2000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc7c069a000) libm.so.6 => /lib64/libm.so.6 (0x00007fc7c0398000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc7c0182000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc7bff66000) libc.so.6 => /lib64/libc.so.6 (0x00007fc7bfb98000) /lib64/ld-linux-x86-64.so.2 (0x00007fc7c190a000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007fc7bf965000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fc7bf761000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007fc7bf551000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007fc7bf34d000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fc7bf133000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fc7bef0c000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fc7becaa000) I have ensured that the link is correct with: [root@rhmssql1 lib64]# odbcinst -q -d -n "ODBC Driver 17 for SQL Server" [ODBC Driver 17 for SQL Server] Description=Microsoft ODBC Driver 17 for SQL Server Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.8.so.1.2 UsageCount=1 I have also followed the excellent process doument at https://wiki.freeradius.org/modules/Rlm_sql_unixodbc and everything works as should except the very last stage (start up of freeradius). Excuse my picking up on this as it is a typo I expect - but in there you have labelled port "1443" under the DSN (Section 4:Server = tcp:192.0.2.1, 1443 and suspect you meant 1433). In the /etc/raddb/mods-available - I completed the following changes: sql { dialect = "mssql" driver = "rlm_sql_unixodbc" # driver = "rlm_sql_${dialect}" # Connection info: # server = "rhmssql1" port = 1433 login = "radius" password = "radPass_123" Again, many apologies if the answer to this is obvious (which I know it is from the error) but this e-mail has been a last resort. There are articles on the wiki but they are from 2007 and 2008. I have completed a "find" for the named file and cannot find it "find / -name "*rlm_sql*" Thank you for any pointers.
On Nov 25, 2021, at 9:50 AM, Clive Allen <cliveallen0907@gmx.com> wrote:
Firstly, my apologies if this is not freeradius related but am hoping someone may have seen this before or could point me in the right direction please:
I am trying to connect to an mssql database with freeradius on redhat.
If you're using the RedHat packages, then perhaps ask RedHat about that.
When running radiusd -X I am getting the following readout (error):
Nov 25 13:40:27 rhmssql1 radiusd[7698]: Creating attribute Unix-Group Nov 25 13:40:27 rhmssql1 radiusd[7698]: Could not link driver rlm_sql_unixodbc: /usr/lib64/freeradius/rlm_sql_unixodbc.so: cannot open shared object file: No such file or directory
i.e. you're trying to use a module without having it installed.
I have checked the directory /usr/lib64/freeradius/ and sure enough the file rlm_sql_unixodbc.so does not exist there.
Exactly.
I have tested with isql -v rhmssql1 radius radPass_123 and that works fine. I can also access the DB with either radius or SA.
I have configured /etc/odbc.ini with the following:
That's ODBC. It's needed, but it's not enough. You also need the rlm_sql_unixodbc.so file.
I have checked the locations as follows:
[root@rhmssql1 lib64]# ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.8.so.1.2
That's irrelevant. "I can't find rlm_sql_unixodbc, but there are a bunch of other libraries on the system!"
I have also followed the excellent process doument at https://wiki.freeradius.org/modules/Rlm_sql_unixodbc and everything works as should except the very last stage (start up of freeradius). Excuse my picking up on this as it is a typo I expect - but in there you have labelled port "1443" under the DSN (Section 4:Server = tcp:192.0.2.1, 1443 and suspect you meant 1433).
The Wiki is editable for a reason. Perhaps it can be fixed?
In the /etc/raddb/mods-available - I completed the following changes: sql { dialect = "mssql" driver = "rlm_sql_unixodbc"
Did you make sure that the rlm_sql_unixodbc driver was installed?
Again, many apologies if the answer to this is obvious (which I know it is from the error) but this e-mail has been a last resort. There are articles on the wiki but they are from 2007 and 2008.
I have completed a "find" for the named file and cannot find it "find / -name "*rlm_sql*"
So you didn't install *any* of the SQL modules for FreeRADIUS. Perhaps try that? Search the RedHat RPMs for "freeradius" and "sql". Then, install the relevant packages. Alan DeKok.
participants (2)
-
Alan DeKok -
Clive Allen