freeradius authentication problem
Mallikarjuna Peddappanavara Karibasappa
mallikarjuna.peddappanavara at igrid-td.com
Fri Jul 13 08:57:15 CEST 2018
I have compiled the nginx library withoudt any warnings
Debug outpu is :-
checking for OS
+ Linux 4.9.0-6-amd64 x86_64
checking for C compiler ... found
+ using GNU C compiler
+ gcc version: 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for gcc builtin 64 bit byteswap ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for EPOLLEXCLUSIVE ... found
checking for O_PATH ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for prctl(PR_SET_KEEPCAPS) ... found
checking for capabilities ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... not found
checking for nogroup group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for sched_setaffinity() ... found
checking for SO_SETFIB ... not found
checking for SO_REUSEPORT ... found
checking for SO_ACCEPTFILTER ... not found
checking for SO_BINDANY ... not found
checking for IP_TRANSPARENT ... found
checking for IP_BINDANY ... not found
checking for IP_BIND_ADDRESS_NO_PORT ... found
checking for IP_RECVDSTADDR ... not found
checking for IP_SENDSRCADDR ... not found
checking for IP_PKTINFO ... found
checking for IPV6_RECVPKTINFO ... found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for eventfd() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint32_t ... found
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for AF_INET6 ... found
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for pwritev() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for clock_gettime(CLOCK_MONOTONIC) ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
checking for PCRE library ... found
checking for PCRE JIT support ... found
checking for zlib library ... found
creating objs/Makefile
Configuration summary
+ using system PCRE library
+ OpenSSL library is not used
+ using system zlib library
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx modules path: "/usr/local/nginx/modules"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
Thank you,
Best Regards,*Mallikarjuna PK*Email: mallikarjuna.peddappanavara at igrid-td.com
Mobile: +91-9535744695
On 13 July 2018 at 11:24, Mallikarjuna Peddappanavara Karibasappa <
mallikarjuna.peddappanavara at igrid-td.com> wrote:
> Hi Alan,
>
> For me its works fine if I test using below command but when I send the
> username and password from client browser to radius server then its not
> working.
>
> command
> * - radtest bob hello 127.0.0.1 0 testing123*
> Debug output :-
>
> (0) Received Access-Request Id 116 from 127.0.0.1:39749 to 127.0.0.1:1812
> length 73
> (0) User-Name = "bob"
> (0) User-Password = "hello"
> (0) NAS-IP-Address = 127.0.1.1
> (0) NAS-Port = 0
> (0) Message-Authenticator = 0x0f2ac118f29f86938e4472a97369751e
> (0) # Executing section authorize from file /etc/freeradius/3.0/sites-
> enabled/default
>
> (0) authorize {
> (0) policy filter_username {
> (0) if (&User-Name) {
> (0) if (&User-Name) -> TRUE
> (0) if (&User-Name) {
> (0) if (&User-Name =~ / /) {
> (0) if (&User-Name =~ / /) -> FALSE
> (0) if (&User-Name =~ /@[^@]*@/ ) {
> (0) if (&User-Name =~ /@[^@]*@/ ) -> FALSE
> (0) if (&User-Name =~ /\.\./ ) {
> (0) if (&User-Name =~ /\.\./ ) -> FALSE
> (0) if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/)) {
> (0) if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))
> -> FALSE
> (0) if (&User-Name =~ /\.$/) {
> (0) if (&User-Name =~ /\.$/) -> FALSE
> (0) if (&User-Name =~ /@\./) {
> (0) if (&User-Name =~ /@\./) -> FALSE
> (0) } # if (&User-Name) = notfound
> (0) } # policy filter_username = notfound
> (0) [preprocess] = ok
> (0) [chap] = noop
> (0) [mschap] = noop
> (0) [digest] = noop
> (0) suffix: Checking for suffix after "@"
> (0) suffix: No '@' in User-Name = "bob", looking up realm NULL
> (0) suffix: No such realm "NULL"
> (0) [suffix] = noop
> (0) eap: No EAP-Message, not doing EAP
> (0) [eap] = noop
> (0) files: users: Matched entry bob at line 1
> (0) [files] = ok
> (0) [expiration] = noop
> (0) [logintime] = noop
> (0) [pap] = updated
> (0) } # authorize = updated
> (0) Found Auth-Type = PAP
> (0) # Executing group from file /etc/freeradius/3.0/sites-enabled/default
> (0) Auth-Type PAP {
> (0) pap: Login attempt with password
> (0) pap: Comparing with "known good" Cleartext-Password
> (0) pap: User authenticated successfully
> (0) [pap] = ok
> (0) } # Auth-Type PAP = ok
> (0) # Executing section post-auth from file /etc/freeradius/3.0/sites-
> enabled/default
> (0) post-auth {
> (0) update {
> (0) No attributes updated
> (0) } # update = noop
> (0) [exec] = noop
> (0) policy remove_reply_message_if_eap {
> (0) if (&reply:EAP-Message && &reply:Reply-Message) {
> (0) if (&reply:EAP-Message && &reply:Reply-Message) -> FALSE
> (0) else {
> (0) [noop] = noop
> (0) } # else = noop
> (0) } # policy remove_reply_message_if_eap = noop
> (0) } # post-auth = noop
> (0) Sent Access-Accept Id 116 from 127.0.0.1:1812 to 127.0.0.1:39749
> length 0
> (0) Finished request
> Waking up in 4.9 seconds.
> (0) Cleaning up request packet ID 116 with timestamp +4
>
> Thank you,
>
> Best Regards,*Mallikarjuna PK*Email: mallikarjuna.peddappanavara at igrid-td.com
> Mobile: +91-9535744695
>
>
> On 13 July 2018 at 10:58, Mallikarjuna Peddappanavara Karibasappa <
> mallikarjuna.peddappanavara at igrid-td.com> wrote:
>
>> Dears,
>>
>> I'm using the following module for radius authentication.
>>
>> https://github.com/qudreams/nginx-http-radius-module
>>
>> Is this module is too old to use ?
>>
>> Thank you,
>>
>> Best Regards,*Mallikarjuna PK*Email: mallikarjuna.peddappanavara at igrid-td.com
>> Mobile: +91-9535744695
>>
>>
>> On 12 July 2018 at 18:51, Alan Buxey <alan.buxey at gmail.com> wrote:
>>
>>> hi,
>>>
>>> works fine for me:
>>>
>>> (0) Received Access-Request Id 2 from 127.0.0.1:49092 to 127.0.0.1:1812
>>> length 67
>>> (0) User-Name = "bob"
>>> (0) User-Password = "hello"
>>> (0) Service-Type = Authorize-Only
>>> (0) Message-Authenticator = 0x505a938561632db53b6806c179d7053b
>>> (0) # Executing section authorize from file
>>> /etc/raddb/sites-enabled/default
>>> (0) authorize {
>>> (0) policy filter_username {
>>> (0) if (&User-Name) {
>>> (0) if (&User-Name) -> TRUE
>>> (0) if (&User-Name) {
>>> (0) if (&User-Name =~ / /) {
>>> (0) if (&User-Name =~ / /) -> FALSE
>>> (0) if (&User-Name =~ /@[^@]*@/ ) {
>>> (0) if (&User-Name =~ /@[^@]*@/ ) -> FALSE
>>> (0) if (&User-Name =~ /\.\./ ) {
>>> (0) if (&User-Name =~ /\.\./ ) -> FALSE
>>> (0) if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/)) {
>>> (0) if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))
>>> ->
>>> FALSE
>>> (0) if (&User-Name =~ /\.$/) {
>>> (0) if (&User-Name =~ /\.$/) -> FALSE
>>> (0) if (&User-Name =~ /@\./) {
>>> (0) if (&User-Name =~ /@\./) -> FALSE
>>> (0) } # if (&User-Name) = notfound
>>> (0) } # policy filter_username = notfound
>>> (0) [preprocess] = ok
>>> (0) [chap] = noop
>>> (0) [mschap] = noop
>>> (0) [digest] = noop
>>> (0) suffix: Checking for suffix after "@"
>>> (0) suffix: No '@' in User-Name = "bob", looking up realm NULL
>>> (0) suffix: No such realm "NULL"
>>> (0) [suffix] = noop
>>> (0) eap: No EAP-Message, not doing EAP
>>> (0) [eap] = noop
>>> (0) files: users: Matched entry bob at line 87
>>> (0) [files] = ok
>>> (0) [expiration] = noop
>>> (0) [logintime] = noop
>>> (0) [pap] = updated
>>> (0) } # authorize = updated
>>> (0) Found Auth-Type = PAP
>>> (0) # Executing group from file /etc/raddb/sites-enabled/default
>>> (0) Auth-Type PAP {
>>> (0) pap: Login attempt with password
>>> (0) pap: Comparing with "known good" Cleartext-Password
>>> (0) pap: User authenticated successfully
>>> (0) [pap] = ok
>>> (0) } # Auth-Type PAP = ok
>>> (0) # Executing section post-auth from file
>>> /etc/raddb/sites-enabled/default
>>> (0) post-auth {
>>> (0) update {
>>> (0) No attributes updated
>>> (0) } # update = noop
>>> (0) [exec] = noop
>>> (0) policy remove_reply_message_if_eap {
>>> (0) if (&reply:EAP-Message && &reply:Reply-Message) {
>>> (0) if (&reply:EAP-Message && &reply:Reply-Message) -> FALSE
>>> (0) else {
>>> (0) [noop] = noop
>>> (0) } # else = noop
>>> (0) } # policy remove_reply_message_if_eap = noop
>>> (0) } # post-auth = noop
>>> (0) Sent Access-Accept Id 2 from 127.0.0.1:1812 to 127.0.0.1:49092
>>> length 0
>>> (0) Finished request
>>> Waking up in 4.9 seconds.
>>> (1) Received Access-Request Id 90 from 127.0.0.1:49092 to 127.0.0.1:1812
>>> length 67
>>> (1) User-Name = "bob"
>>> (1) User-Password = "hello"
>>> (1) Service-Type = Authorize-Only
>>> (1) Message-Authenticator = 0x44f58b7d76d7f00a1ed55ee8a7a2165d
>>> (1) # Executing section authorize from file
>>> /etc/raddb/sites-enabled/default
>>> (1) authorize {
>>> (1) policy filter_username {
>>> (1) if (&User-Name) {
>>> (1) if (&User-Name) -> TRUE
>>> (1) if (&User-Name) {
>>> (1) if (&User-Name =~ / /) {
>>> (1) if (&User-Name =~ / /) -> FALSE
>>> (1) if (&User-Name =~ /@[^@]*@/ ) {
>>> (1) if (&User-Name =~ /@[^@]*@/ ) -> FALSE
>>> (1) if (&User-Name =~ /\.\./ ) {
>>> (1) if (&User-Name =~ /\.\./ ) -> FALSE
>>> (1) if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/)) {
>>> (1) if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))
>>> ->
>>> FALSE
>>> (1) if (&User-Name =~ /\.$/) {
>>> (1) if (&User-Name =~ /\.$/) -> FALSE
>>> (1) if (&User-Name =~ /@\./) {
>>> (1) if (&User-Name =~ /@\./) -> FALSE
>>> (1) } # if (&User-Name) = notfound
>>> (1) } # policy filter_username = notfound
>>> (1) [preprocess] = ok
>>> (1) [chap] = noop
>>> (1) [mschap] = noop
>>> (1) [digest] = noop
>>> (1) suffix: Checking for suffix after "@"
>>> (1) suffix: No '@' in User-Name = "bob", looking up realm NULL
>>> (1) suffix: No such realm "NULL"
>>> (1) [suffix] = noop
>>> (1) eap: No EAP-Message, not doing EAP
>>> (1) [eap] = noop
>>> (1) files: users: Matched entry bob at line 87
>>> (1) [files] = ok
>>> (1) [expiration] = noop
>>> (1) [logintime] = noop
>>> (1) [pap] = updated
>>> (1) } # authorize = updated
>>> (1) Found Auth-Type = PAP
>>> (1) # Executing group from file /etc/raddb/sites-enabled/default
>>> (1) Auth-Type PAP {
>>> (1) pap: Login attempt with password
>>> (1) pap: Comparing with "known good" Cleartext-Password
>>> (1) pap: User authenticated successfully
>>> (1) [pap] = ok
>>> (1) } # Auth-Type PAP = ok
>>> (1) # Executing section post-auth from file
>>> /etc/raddb/sites-enabled/default
>>> (1) post-auth {
>>> (1) update {
>>> (1) No attributes updated
>>> (1) } # update = noop
>>> (1) [exec] = noop
>>> (1) policy remove_reply_message_if_eap {
>>> (1) if (&reply:EAP-Message && &reply:Reply-Message) {
>>> (1) if (&reply:EAP-Message && &reply:Reply-Message) -> FALSE
>>> (1) else {
>>> (1) [noop] = noop
>>> (1) } # else = noop
>>> (1) } # policy remove_reply_message_if_eap = noop
>>> (1) } # post-auth = noop
>>> (1) Sent Access-Accept Id 90 from 127.0.0.1:1812 to 127.0.0.1:49092
>>> length 0
>>> (1) Finished request
>>> Waking up in 4.9 seconds.
>>> (0) Cleaning up request packet ID 2 with timestamp +17
>>> (1) Cleaning up request packet ID 90 with timestamp +17
>>> Ready to process requests
>>>
>>>
>>> this is with
>>>
>>> 1) users file updated to have
>>> bob Cleartext-Password := "hello"
>>>
>>> 2) nginx.conf looks like
>>>
>>> #user nobody;
>>> worker_processes 1;
>>>
>>> #error_log logs/error.log;
>>> #error_log logs/error.log notice;
>>> #error_log logs/error.log info;
>>>
>>> #pid logs/nginx.pid;
>>>
>>>
>>> events {
>>> worker_connections 1024;
>>> }
>>>
>>>
>>> http {
>>> include mime.types;
>>> default_type application/octet-stream;
>>>
>>> #set the directory of radius dictionary.
>>> radius_dict_directory "/usr/local/nginx/raddb/";
>>>
>>> #radius server configuration including
>>>
>>> radius_server "radius_server1" {
>>> #authentication timed-out
>>> auth_timeout 5;
>>>
>>> #limit to resend the request
>>> resend_limit 3;
>>>
>>> #radius authentication server url.
>>> url "127.0.0.1:1812";
>>>
>>> #share secret
>>> share_secret "testing123";
>>> }
>>>
>>> #log_format main '$remote_addr - $remote_user [$time_local]
>>> "$request" '
>>> # '$status $body_bytes_sent "$http_referer" '
>>> # '"$http_user_agent" "$http_x_forwarded_for"';
>>>
>>> #access_log logs/access.log main;
>>>
>>> sendfile on;
>>> #tcp_nopush on;
>>>
>>> #keepalive_timeout 0;
>>> keepalive_timeout 65;
>>>
>>> #gzip on;
>>>
>>> server {
>>> listen 80;
>>> server_name localhost;
>>>
>>> #charset koi8-r;
>>>
>>> #access_log logs/host.access.log main;
>>>
>>> location / {
>>> root html;
>>> index index.html index.htm;
>>> #radius server configuration
>>>
>>> #the third paramter is authentication method,you can set
>>> the following value:
>>> # PAP CHAP MSCHAP MSCHAPV2 EAPMD5
>>>
>>> auth_radius_server "radius_server1" "PAP";
>>>
>>> #authentication realm,you can set the following value:
>>> # Restricted "Close Content" off
>>>
>>> auth_radius "Restricted";
>>> }
>>>
>>> #error_page 404 /404.html;
>>>
>>> # redirect server error pages to the static page /50x.html
>>> #
>>> error_page 500 502 503 504 /50x.html;
>>> location = /50x.html {
>>> root html;
>>> }
>>>
>>> # proxy the PHP scripts to Apache listening on 127.0.0.1:80
>>> #
>>> #location ~ \.php$ {
>>> # proxy_pass http://127.0.0.1;
>>> #}
>>>
>>> # pass the PHP scripts to FastCGI server listening on
>>> 127.0.0.1:9000
>>> #
>>> #location ~ \.php$ {
>>> # root html;
>>> # fastcgi_pass 127.0.0.1:9000;
>>> # fastcgi_index index.php;
>>> # fastcgi_param SCRIPT_FILENAME
>>> /scripts$fastcgi_script_name;
>>> # include fastcgi_params;
>>> #}
>>>
>>> # deny access to .htaccess files, if Apache's document root
>>> # concurs with nginx's one
>>> #
>>> #location ~ /\.ht {
>>> # deny all;
>>> #}
>>> }
>>>
>>>
>>> # another virtual host using mix of IP-, name-, and port-based
>>> configuration
>>> #
>>> #server {
>>> # listen 8000;
>>> # listen somename:8080;
>>> # server_name somename alias another.alias;
>>>
>>> # location / {
>>> # root html;
>>> # index index.html index.htm;
>>> # }
>>> #}
>>>
>>>
>>> # HTTPS server
>>> #
>>> #server {
>>> # listen 443 ssl;
>>> # server_name localhost;
>>>
>>> # ssl_certificate cert.pem;
>>> # ssl_certificate_key cert.key;
>>>
>>> # ssl_session_cache shared:SSL:1m;
>>> # ssl_session_timeout 5m;
>>>
>>> # ssl_ciphers HIGH:!aNULL:!MD5;
>>> # ssl_prefer_server_ciphers on;
>>>
>>> # location / {
>>> # root html;
>>> # index index.html index.htm;
>>> # }
>>> #}
>>>
>>> }
>>>
>>> those were the only 2 system files edited(*)
>>>
>>>
>>> however, that nginx plugin is using some really old FreeRADIUS client
>>> library stuff.
>>>
>>> (*)I had to edit the dictionary files a tonne because it doesn't support
>>> eg
>>> vsa, octets[], integer64, ipv4prefix, decimal VSA values etc etc.
>>>
>>>
>>> its very very likely, if you haven't edited the plugin source code (no
>>> need
>>> - but nginx needs to be compiled without -Werror because of the plugin
>>> code) , that you have borked your dictionary files up in some horrendous
>>> way that is breaking this....
>>>
>>> alan
>>> -
>>> List info/subscribe/unsubscribe? See http://www.freeradius.org/list
>>> /users.html
>>>
>>
>>
>
More information about the Freeradius-Users
mailing list