<div class="gmail_quote"><div><div class="h5"><div class="gmail_quote"><br><div>i want to limit user's behavior, such as a username can login only once at the same time...</div><div><br></div><div>1、modifiy default and inner-tunnel in</div>
<div><br></div><div>#  Session database, used for checking Simultaneous-Use. Either the radutmp </div>

<div>#  or rlm_sql module can handle this.</div><div>#  The rlm_sql module is *much* faster</div><div>session {</div><div>        #radutmp</div><div><br></div><div>        #  See "Simultaneous Use Checking Querie" in sql.conf</div>


<div>        sql</div><div><br></div><div>}</div><div>2、modify dialup.conf in etc/raddb/sql/mysql</div><div><br></div><div># Uncomment simul_count_query to enable simultaneous use checking</div><div> </div><div>simul_count_query = "SELECT COUNT(*) \</div>


<div>                            FROM ${acct_table1} \</div><div>                            WHERE username = '%{SQL-User-Name}' \</div><div>                             AND acctstoptime IS NULL"</div><div>   </div>


<div>3、add a entry to the table radgorucheck </div><div>INSERT INTO `radgroupcheck` ( `id` , `GroupName` , `Attribute` , `op` , `Value` ) </div><div>VALUES ( </div><div>NULL , ’user’, ’Simultaneous-Use’, ’:=’, ’1’</div><div>


);</div><div><br></div><div>4. update the user "test"  to the group "user"</div><div><br></div><div><br></div><div>i finally tried successfully, but if , i say if the radius server was down suddenly or the user logout improperly(such as he poweroff the computer directly). then the record will still be record in the table as he was still online ...so we need to modify the record, but how to ? can freeradius judge it by itself, or how to judge the user if offline ?</div>


<div><br></div></div>-- <br>Spacelee<br>
</div></div></div><br><br clear="all"><br>-- <br>Spacelee<br>