How to kick a logged user
Eduardo Bejar
wonka at linkabu.net
Tue Feb 7 23:58:57 CET 2006
Hi,
Thanks for the answers. Well after testing a while and checking the dusty
radkill script, I´d like to comment, for the mailing list archive, about
what I tested/found:
- For the record: Freeradius can´t kick a logged user. There's no
configuration option on radiusd.conf or something to kick a connected user.
- To kick a user you should access the NAS and reset the port where the user
is connected to.
- To create a script for this task, you can:
1.- Get the port where the user is logged with the radwho command.
i.e.:
radwho | grep 'username' | awk '{print $3 $6}'
(this should give you a string with the port and the
NAS
where username is connected)
2.- Telnet to the NAS and reset the port.
i.e.:
you can use the PHPTelnet.php class
(http://www.geckotribe.com/php-telnet/)
Then you can do something like this:
require_once "PHPTelnet.php";
$telnet = new PHPTelnet();
$result =
$telnet->Connect('Nas_IP','Nas_root_user','Nas_root_pwd');
$command_to_send="reset ".$port;
$telnet->DoCommand($command_to_send);
$telnet->Disconnect();
or adjust it with the commands that your NAS uses.
HTH someone in the future.
Edo
More information about the Freeradius-Users
mailing list