[K12OSN] log off users via ssh?

Brian Chivers brian at portsmouth-college.ac.uk
Thu Mar 10 16:23:49 UTC 2005


Dan Young wrote:
> On Thu, 2005-03-10 at 08:54 -0600, Greg Hovland wrote:
>> Is there a way to log off users that are not suppose to be logged.
>>
>> This would be done from a remote site, possibly via ssh.
>
> The BOFH method is 'pkill -u username', where username is the user you
> want to "log off."

Do a ps -aux | grep sshd will give you a list of ssh processes then you
could do a kill -9 `pid` ?

You could script this to look for unauthorised users then kill them
automagically, run this as a cron job and your away.

Not sure how to do the script but wouldn't be too hard.

Brian


---------------------------------------------------------------
    The views expressed here are my own and not necessarily 
                the views of Portsmouth College             




More information about the K12OSN mailing list