รบกวนขอ freeradius ใช้ MD5-Password Mysql ?

โปรแกรมบน CentOS ที่ควรติดตั้งใช้งานร่วมกับ VoIP Server

รบกวนขอ freeradius ใช้ MD5-Password Mysql ?

โพสต์โดย tapoo999 » 14 พ.ค. 2010 13:10

คือผม เซ็ต freeradius ให้ใช้ฐานข้อมุล mysql โดย เซ็ต บน Centos

ติดปัญหาตรงที่ ผม insert 2 บรรทัดด้านล่างนี้แล้วลอง test

1. INSERT INTO radcheck (UserName, Attribute, Value, Op) VALUES ('test', 'Password', '1234', '==');
2 .INSERT INTO radcheck (UserName, Attribute, Value, Op) VALUES ('test2', 'MD5-Password', md5('1234'), ':=');

ผมลอง test ตามด้านล่างนี้ ใช้ user ตัวแรก ผ่าน
radtest test 1234 localhost 0 testradius

Sending Access-Request of id 227 to 127.0.0.1 port 1812
User-Name = "test"
User-Password = "1234"
NAS-IP-Address = 255.255.255.255
NAS-Port = 0
rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=227, length=32
Idle-Timeout = 3600
Service-Type = Login-User


ผมลอง test ตามด้านล่างนี้ ใช้ user ตัวที่สอง ไม่ผ่าน ?
radtest test2 1234 localhost 0 testradius

Sending Access-Request of id 231 to 127.0.0.1 port 1812
User-Name = "test2"
User-Password = "1234"
NAS-IP-Address = 255.255.255.255
NAS-Port = 0
Re-sending Access-Request of id 231 to 127.0.0.1 port 1812
User-Name = "test2"
User-Password = "1234"
NAS-IP-Address = 255.255.255.255
NAS-Port = 0
rad_recv: Access-Reject packet from host 127.0.0.1:1812, id=231, length=20


รบกวนผู้รู้ทีครับ ผมต้องไปแก้ตรงไหนให้ใช้ Attribute MD5-Password ?

ขอบคุณมากๆครับ
tapoo999
 
โพสต์: 2
ลงทะเบียนเมื่อ: 14 พ.ค. 2010 13:05

Re: รบกวนขอ freeradius ใช้ MD5-Password Mysql ?

โพสต์โดย smartsoft » 14 พ.ค. 2010 17:57

tapoo999 เขียน:คือผม เซ็ต freeradius ให้ใช้ฐานข้อมุล mysql โดย เซ็ต บน Centos

2 .INSERT INTO radcheck (UserName, Attribute, Value, Op) VALUES ('test2', 'MD5-Password', md5('1234'), ':=');

ผมลอง test ตามด้านล่างนี้ ใช้ user ตัวที่สอง ไม่ผ่าน ?
radtest test2 1234 localhost 0 testradius

Sending Access-Request of id 231 to 127.0.0.1 port 1812
User-Name = "test2"
User-Password = "1234"
NAS-IP-Address = 255.255.255.255
NAS-Port = 0
Re-sending Access-Request of id 231 to 127.0.0.1 port 1812
User-Name = "test2"
User-Password = "1234"
NAS-IP-Address = 255.255.255.255
NAS-Port = 0
rad_recv: Access-Reject packet from host 127.0.0.1:1812, id=231, length=20


รบกวนผู้รู้ทีครับ ผมต้องไปแก้ตรงไหนให้ใช้ Attribute MD5-Password ?

ขอบคุณมากๆครับ


ตรงบรรทัดนี้ >> radtest test2 1234 localhost 0 testradius
ให้คุณทำการ md5('1234') ก่อน จากนั้นเอาค่าที่ได้จาก md5 ไปใส่แทน ตรง 1234
สมมติ md5('1234') แล้วได้ค่าออกมาเป็น ianakertifaenq
ก็ให้ใส่เป็น

radtest test2 ianakertifaenq localhost 0 testradius

แทนครับ
smartsoft
Gold Member
 
โพสต์: 80
ลงทะเบียนเมื่อ: 11 มี.ค. 2010 09:44

Re: รบกวนขอ freeradius ใช้ MD5-Password Mysql ?

โพสต์โดย tapoo999 » 15 พ.ค. 2010 12:55

ขอบคุณมากนะครับที่ช่วยตอบคำถามให้นะครับ

ผมลองเอาไปปรับแก้ดูแล้ว ก้ยังไม่ได้นะครับ สิ่งที่ผม test

# radtest test2 81dc9bdb52d04dc20036dbd8313ed055 localhost 0 testradius

Sending Access-Request of id 104 to 127.0.0.1 port 1812
User-Name = "test2"
User-Password = "81dc9bdb52d04dc20036dbd8313ed055"
NAS-IP-Address = 255.255.255.255
NAS-Port = 0
Re-sending Access-Request of id 104 to 127.0.0.1 port 1812
User-Name = "test2"
User-Password = "81dc9bdb52d04dc20036dbd8313ed055"
NAS-IP-Address = 255.255.255.255
NAS-Port = 0
rad_recv: Access-Reject packet from host 127.0.0.1:1812, id=104, length=20


มีข้อสงสัยคือ
Radius สามารถ เอารหัสมา ทำ md5 เพื่อให้ได้ digest แล้วส่งไปเช็ค กับ mysql (มีการเก็บ digest ใว้แล้ว) ได้ไหมครับ ?
user ส่ง pass = 1234 ----> ( Radius ----> md5(1234) ----> digest(81dc9bdb52d04dc20036dbd8313ed055) ) ----> ตรวจสอบ digest(81dc9bdb52d04dc20036dbd8313ed055) ใน mysql


รบกวนทีครับ ขอบคุณมากครับ
tapoo999
 
โพสต์: 2
ลงทะเบียนเมื่อ: 14 พ.ค. 2010 13:05


ย้อนกลับไปยัง CentOS - The Community Enterprise Operating System

ผู้ใช้งานขณะนี้

่กำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และ บุคคลทั่วไป 1 ท่าน

cron