您好,登錄后才能下訂單哦!
Linux+FreeRadius+Mysql實(shí)現(xiàn)Radius認(rèn)證
第一部分服務(wù)器端配置
一、基礎(chǔ)系統(tǒng)準(zhǔn)備
1、安裝Redhat-Linux操作系統(tǒng),系統(tǒng)版本號(hào)5.5
2、安裝Mysql所有3個(gè)組件,如下圖所示:
3、安裝FreeRadius2所有9個(gè)組件,如下圖所示:
4、安裝pear所有15個(gè)組件,如下圖所示:
5、安裝http組件,如下圖所示
6、安裝php-mysql組件
二、配置Mysql
1、進(jìn)入Mysql數(shù)據(jù)庫(kù):
mysql -u root –p
輸入回車(chē)
2、mysql庫(kù)受權(quán):
mysql>use mysql
//進(jìn)入mysql庫(kù)
mysql>GRANT ALL PRIVILEGES ON *.*TO root@localhost IDENTIFIED BY '<rootpassword>' WITH GRANTOPTION;
//主數(shù)據(jù)庫(kù)數(shù)據(jù)庫(kù)root用戶授權(quán)本地登錄
mysql> GRANT ALL PRIVILEGES ON *.*TO 'root'@'%'IDENTIFIED BY '<rootpassword>' WITH GRANT OPTION;
// 主數(shù)據(jù)庫(kù)數(shù)據(jù)庫(kù)root用戶授權(quán)遠(yuǎn)端登錄
mysql> flush privileges;
3、創(chuàng)建名為“Radius”的數(shù)據(jù)庫(kù):
mysql -u root -p
CREATE DATABASE radius;
//創(chuàng)建數(shù)據(jù)庫(kù)名為radius
GRANT ALL ON radius.* TO <radiusname>@localhostIDENTIFIED BY "<radiuspassword>";
//radius數(shù)據(jù)庫(kù)用戶授權(quán)本地登錄
GRANT ALL ON radius.* TO <radiusname>@"%"IDENTIFIED BY "<radiuspassword>";
// radius數(shù)據(jù)庫(kù)用戶授權(quán)遠(yuǎn)端登錄
4、導(dǎo)入和建立表結(jié)構(gòu):
mysql -u root -p radius </etc/raddb/sql/mysql/schema.sql
//導(dǎo)入用戶列表至radius庫(kù)
mysql -u root -p radius < /etc/raddb/sql/mysql/nas.sql
//導(dǎo)入NAS列表至radius庫(kù)
三、配置FreeRadius
1、配置clients.conf:
修改/etc/raddb/clients.conf文件:
client x.x.x.x/x {
//NAS地址限制
secret = <naspassword>
//NAS密碼
shortname = <nasname>
//NAS別名
}
2、配置sql.conf:
修改/etc/raddb/sql.conf文件:
database = "mysql"
login = "<radiusname>"
//數(shù)據(jù)庫(kù)用戶名
password = "<radiuspassword>"
//數(shù)據(jù)庫(kù)密碼
3、配置radiusd.conf
修改/etc/raddb/radiusd.conf文件:
$INCLUDE sql.conf
//取消注釋
4、配置sites-enabled/default
修改/etc/raddb/sites-enabled/default文件:
authorize {
sql
//取消注釋
}
authenticate {
sql
//取消注釋
}
}
accounting {
sql
//取消注釋
}
四、添加NAS設(shè)備登錄賬號(hào)(可選)
mysql -u root –p
use radius
insert into radcheck(username,attribute,value,op) values ('<logname>','Cleartext-Password','<logpassword>',':=')
五、安裝Daloradius
wget http://nchc.dl.sourceforge.net/project/daloradius/daloradius/daloradius0.9-9/daloradius-0.9-9.tar.gz
//下載安裝包
tar zxvfdaloradius-0.9-9.tar.gz
//解壓安裝包
mv daloradius-0.9-9 /var/www/html/daloradius
//復(fù)制至web根目錄下
chown -R apache:apache/var/www/html/daloradius
//受權(quán)apache訪問(wèn)
六、配置Daloradius
1、導(dǎo)入mysql元素
mysql -uroot -p radius </var/www/html/daloradius/contrib/db/mysql-daloradius.sql
//導(dǎo)入radius庫(kù)中
mysql -uroot -p radius < /var/www/html/daloradius/contrib/db/fr2-mysql-daloradius-and-freeradius.sql
2、設(shè)置配置文件
/var/www/html/radius/library/daloradius.conf.php
$configValues['CONFIG_DB_ENGINE'] = 'mysql';
$configValues['CONFIG_DB_HOST'] = 'localhost';
$configValues['CONFIG_DB_PORT'] = '3306';
$configValues['CONFIG_DB_USER'] = '<radiusname>';
//數(shù)據(jù)庫(kù)用戶名
$configValues['CONFIG_DB_PASS'] = '<radiuspassword>';
//數(shù)據(jù)庫(kù)密碼
$configValues['CONFIG_DB_NAME'] = 'radius';
$configValues['CONFIG_FILE_RADIUS_PROXY'] = '/etc/raddb/proxy.conf';
$configValues['CONFIG_PATH_RADIUS_DICT'] = '';
$configValues['CONFIG_PATH_DALO_VARIABLE_DATA'] = '/var/www/html/daloradius/var';
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。