Monday, February 11, 2008

Kicking a user off of a system (linux)

Quick reference would 'NOT' recommend using these:

last -i1 baduser | awk '{print $3;exit}' | xargs -p --replace iptables -A INPUT -s {} -j drop 

if [ "`who | grep $1`" != "" ] ; then sid=`ps -jU $1 | awk '{print $3}' | tail -1`" kill -HUP $sid echo "$1 was logged in. Just booted $1 out." fi

ps -u username | grep -v PID | awk '{print $1}' | xargs kill

kill $(ps -u username | grep -v PID | awk '{print $1}')
posted by Stephen Reese at

0 Comments:

Post a Comment

<< Home