|
ru.unix.bsd- RU.UNIX.BSD ------------------------------------------------------------------ From : Nick E. Milogradsky 2:5025/900 09 Dec 2004 18:16:33 To : All Subject : Re: freeradius + OpenLDAP = работает или нет ? -------------------------------------------------------------------------------- > > * hi > ** Nick E. Milogradsky => All > >> ===== >> # radtest test xxxxxxxxxxxx localhost 0 xxxxxxxxx >> Sending Access-Request of id 53 to 127.0.0.1:1812 >> User-Name = "test" >> User-Password = "xxxxxx" > > а можно вместо иксов показать реальный пароль? > и еще интересно посмотреть вывод > > ldapsearch -x -D "cn=login,dc=xxx,dc=xxx,dc=ppp,dc=ru" -W > secretpassword > uit=test # ldapsearch -x -D "cn=login,dc=xxx,dc=xxx,dc=ppp,dc=ru" -W uid=test # test, users, xxx.xxx.ppp.ru dn: uid=test,ou=users,dc=xxx,dc=xxx,dc=ppp,dc=ru uid: test cn: Test user sn: Test user title: test homePostalAddress: telephoneNumber: 11-11-11 objectClass: top objectClass: person objectClass: posixAccount objectClass: inetOrgPerson objectClass: couriermailaccount objectClass: inetLocalMailRecipient objectClass: radiusprofile quota:: MTAyNDAwMDAg uidNumber: 1001 gidNumber: 1001 mailHost: ldap.xxx.ppp.ru mail: test@ldap.xxx.ppp.ru mailLocalAddress: test@ldap.xxx.ppp.ru mailRoutingAddress:: loginShell: /dev/null homeDirectory: /var/imap/home mailbox: test/Maildir/ userPassword:: MTEx # Самое, что для теста ввожу userPassword в формате {clear}. Hо вижу, то что приведено выше в поле userPassword. А должен был быть тестовый пароль 111 Мне главное, чтобы сейчас заработал radtest c 127.0.0.1, поэтому и тестирую его. Hиже приведено результат radtest: # radtest test 111 127.0.0.1 0 xxxxxxxxxxxxx Sending Access-Request of id 103 to 127.0.0.1:1812 User-Name = "test" User-Password = "111" NAS-IP-Address = ldap.xxx.xxx.ppp.ru NAS-Port = 0 rad_recv: Access-Reject packet from host 127.0.0.1:1812, id=103, length=20 rad_decode: Received Access-Reject packet from 127.0.0.1:1812 with invalid signature (err=2)! (Shared secret is incorrect.) radclient: radclient.c:440: send_one_packet: Assertion `radclient->reply == ((void *)0)' failed. /usr/bin/radtest: line 53: 10086 Done ( echo "User-Name = \"$1\""; echo "User-Password = \"$2\""; echo "NAS-IP-Address = $nas"; echo "NAS-Port = $4"; if [ "$6" ]; then echo "Framed-Protocol = PPP"; fi ) 10087 Aborted | $radclient $DICTIONARY -x $3 auth $5 # Hиже приведена диагностика radiusd -X -A # # /usr/sbin/radiusd -X -A ... Ready to process requests. rad_recv: Access-Request packet from host 127.0.0.1:32770, id=163, length=56 User-Name = "test" User-Password = "d\005\240\246\240\273~3\311\301\342\377\230\022\274\370" NAS-IP-Address = 255.255.255.255 NAS-Port = 0 Processing the authorize section of radiusd.conf modcall: entering group authorize for request 0 modcall[authorize]: module "preprocess" returns ok for request 0 users: Matched DEFAULT at 156 modcall[authorize]: module "files" returns ok for request 0 modcall[authorize]: module "mschap" returns noop for request 0 rlm_ldap: - authorize rlm_ldap: performing user authorization for test radius_xlat: '(uid=test)' radius_xlat: 'ou=users,dc=xxxx,dc=xxx,dc=ppp,dc=ru' rlm_ldap: ldap_get_conn: Checking Id: 0 rlm_ldap: ldap_get_conn: Got Id: 0 rlm_ldap: attempting LDAP reconnection rlm_ldap: (re)connect to localhost:389, authentication 0 rlm_ldap: bind as cn=login,dc=xxx,dc=xxx,dc=ppp,dc=ru/xxxxxxxx to localhost:389 rlm_ldap: waiting for bind result ... rlm_ldap: Bind was successful rlm_ldap: performing search in ou=users,dc=xxxx,dc=xxx,dc=ppp,dc=ru, with filter (uid=test) rlm_ldap: Password header not found in password 111 for user test rlm_ldap: looking for check items in directory... rlm_ldap: looking for reply items in directory... rlm_ldap: user test authorized to use remote access rlm_ldap: ldap_release_conn: Release Id: 0 modcall[authorize]: module "ldap" returns ok for request 0 modcall: group authorize returns ok for request 0 rad_check_password: Found Auth-Type LDAP auth: type "LDAP" Processing the authenticate section of radiusd.conf modcall: entering group Auth-Type for request 0 rlm_ldap: - authenticate rlm_ldap: login attempt by "test" with password "d??#?#~3####??##" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ Странно, что вот это за бред вместо пароля. И почему у него такой странный вид ? А должен быть 111 Ты видишь что пароль не на русском, там нет русского. rlm_ldap: user DN: uid=test,ou=users,dc=xxx,dc=xxx,dc=ppp,dc=ru rlm_ldap: (re)connect to localhost:389, authentication 1 rlm_ldap: bind as uid=test,ou=users,dc=xxx,dc=xxx,dc=ppp,dc=ru/d??#?#~3####??## to localhost:389 rlm_ldap: waiting for bind result ... rlm_ldap: Bind failed with invalid credentials modcall[authenticate]: module "ldap" returns reject for request 0 modcall: group Auth-Type returns reject for request 0 auth: Failed to validate the user. Login incorrect (rlm_ldap: Bind as user failed): [test/d\005\240\246\240\273~3\311\301\342\377\230\022\274\370] (from client localhost port 0) WARNING: Unprintable characters in the password. ? Double-check the shared secret on the server and the NAS! ========== Вот это тоже я непонимаю, почему "WARNING: Unprintable characters in the password. ?", если пароль 111 ? Откуда взялся этот "Unprintable characters in the password.", я что-то непойму. :-((( ============ Delaying request 0 for 1 seconds Finished request 0 Going to the next request - --- Walking the entire request list --- Waking up in 1 seconds... - --- Walking the entire request list --- Waking up in 1 seconds... - --- Walking the entire request list --- Sending Access-Reject of id 163 to 127.0.0.1:32770 Waking up in 4 seconds... - --- Walking the entire request list --- Cleaning up request 0 ID 163 with timestamp 41b82494 Nothing to do. Sleeping until we see a request. # >> Ready to process requests. >> rad_recv: Access-Request packet from host 127.0.0.1:32769, id=53, >> length=56 >> User-Name = "test" >> User-Password = >> "\320Q\010,+\270\253\332\360\037I\223\215\302\\\362" > > совсем не xxxxxxx, да? пароль случаем не на русском? > >> [test/\320Q\010,+\270\253\332\360\037I\223\215\302\\\362] > > вот, ещо раз. > >> Помоги понять, что я не так делаю. > > покеш чо в slapd.conf и реальную entry на пользователя test тоже покеш. ------------------------------- # cat radius.conf ... ldap { server = "localhost" identity = "cn=login,dc=xxx,dc=xxx,dc=ppp,dc=ru" password = xxxxxxxx basedn = "ou=users,dc=xxx,dc=xxx,dc=ppp,dc=ru" base_filter = "(objectClass=posixAccount)" filter = "(uid=%{Stripped-User-Name:-%{User-Name}})" #filter = "(&(objectClass=posixAccount)(uid=%u))" #authtype = "MS-CHAP" # set this to 'yes' to use TLS encrypted connections # to the LDAP database by using the StartTLS extended # operation. # The StartTLS operation is supposed to be used with normal # ldap connections instead of using ldaps (port 689) connections start_tls = no tls_mode = no # default_profile = "cn=radprofile,ou=dialup,o=My Org,c=UA" # profile_attribute = "radiusProfileDn" #access_attr = "dialupAccess" # Mapping of RADIUS dictionary attributes to LDAP # directory attributes. dictionary_mapping = ${raddbdir}/ldap.attrmap ldap_connections_number = 64 password_header = "{clear}" password_attribute = userPassword # groupname_attribute = cn # groupmembership_filter = "(|(&(objectClass=GroupOfNames)(member=%{Ldap-UserDn}))((objectClass=GroupOfUniq ueNames)(uniquemember=%{Ldap-UserDn})))" # groupmembership_attribute = radiusGroupName timeout = 3 timelimit = 5 net_timeout = 1 #compare_check_items = yes #access_attr_used_for_allow = yes } ... authorize { preprocess # auth_log # chap # attr_filter # eap # realmslash # suffix files # etc_smbpasswd mschap ldap # daily } # Authentication. # authenticate { Auth-Type PAP { pap } Auth-Type CHAP { chap } Auth-Type MS-CHAP { mschap } #pam unix Auth-Type LDAP { ldap } #eap } ... accounting { acct_unique detail # daily unix # wtmp file # ldap radutmp # sradutmp # main_pool } .... --------------------- # cat users ... DEFAULT Auth-Type := LDAP Fall-Through = 1 DEFAULT Auth-Type := System Fall-Through = 1 DEFAULT Simultaneous-Use :=1 DEFAULT Service-Type == Framed-User Framed-IP-Address = 255.255.255.254, Framed-MTU = 576, Service-Type = Framed-User, Fall-Through = Yes --------------------- # cat clients.conf ... client 127.0.0.1 { secret = xxxxxxxxxxxxxxxx shortname = localhost nastype = other # localhost isn't usually a NAS... # login = !root # password = someadminpas } # Объясни пожалуйста, что и где я не так сделал ? И где я допустил ошибку. Зачем тебе slapd.conf ? Там все работает, смотри, что в протоколе работа radiusd, видно, что у cn=login,dc=xxx,dc=xxx,dc=ppp,dc=ru, есть доступ для чтения всей ветки ou=users,dc=xxx,dc=xxx,dc=ppp,dc=ru. Так что посылка slapd.conf я считаю не актуальной, но если сильно нужно могу процитировать. При этом на том-же самом slapd.conf почта (sendmail/courier) работает, все нормально авторизуется, и с паролем таких проблем нет, как тут. Тут я что-то ничего непонимаю. :-(( > и еще покеш как ты радиус в циске прописал. > и что у тебя в raddb/clients.conf тоже покеш. > и ещо там что-то было про raddb/users, вот его тоже покеш. > > * bye Спасибо. ---- С уважением, Милоградский H.Э. --- Microsoft Outlook Express 6.00.2900.2180 * Origin: Comment is superfluous... (2:5025/900@fidonet) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.unix.bsd/13384163b1e53.html, оценка из 5, голосов 10
|