local认证

文件路径 用途 示例 备注
#gedit /usr/local/etc/raddb/sites-available/default
#gedit /usr/local/etc/raddb/sites-enabled/default
选择账户数据库
设置authorize{} 中files为显性,sql为隐性

选择从'users'文件读取用户预设信息
 
#gedit /usr/local/etc/raddb/users
添加新的账号密码
在最后面添加
tessie Cleartext-Password := "tessie123"
 
#gedit /usr/local/etc/raddb/clients.conf
添加新的代理主机
在最后面添加
client 10.10.200.0/24 {
secret = 111111  
shortname = tessie
} localhost的secret默认为testing123
 
#radiusd -X
#radtest tessie tessie123 10.10.200.100 0 111111
 测试
radtest [账号] [密码] [认证位址] [NAS端口] [秘钥]

#gedit /usr/local/etc/raddb/sites-available/default
#gedit /usr/local/etc/raddb/sites-enabled/default
选择账户数据库
设置authorize{} 中files为隐性,sql为显性

选择从sql数据库读取用户预设信息
 
#mysql -u root -p
Enter password:456456
mysql> use freeradius;
mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Auth-Type',':=','Local');
mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Service-Type',':=','Framed-User');
mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Framed-IP-Address',':=','255.255.255.255');
mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Framed-IP-Netmask',':=','255.255.255.0');
 建立组信息    
mysql> insert into radcheck (username,attribute,op,value) values ('test','User-Password',':=','test');
 建立用户信息    
mysql> insert into radusergroup (username,groupname) values ('test','user');

关联用户与组

   
mysql> insert  into radreply(username,attribute,op,value) values('test','Reply-Message','=','Yes,Good!');

添加用户回复信息

   
#gedit /usr/local/etc/raddb/clients.conf
添加新的代理主机
在最后面添加
client 10.10.200.0/24 {
secret = 111111  
shortname = tessie
} localhost的secret默认为testing123
 
#radiusd -X
#radtest test test localhost 0 testing123
#radtest test test 10.10.200.100 0 111111
 测试
radtest [账号] [密码] [认证位址] [NAS端口] [秘钥]
 
上一篇:cnblog code syntaxhighlighter view


下一篇:Linux内核分析——期末总结