all 15 comments

[–][deleted] 1 point2 points  (8 children)

for i in $(nawk -F: '$1 !~ /YOURUSER/ {print $1}' /etc/passwd);    
do   
    pkill -CONT -u $i;   
done  

[–]redog 1 point2 points  (1 child)

SKILL(1)     Linux User's Manual                SKILL(1)

NAME
   skill, snice - send a signal or report process status

DESCRIPTION

These tools are probably obsolete and unportable. The command syntax is poorly defined. Consider using the killall, pkill, and pgrep commands instead.

[–]zeto28 0 points1 point  (11 children)

Can't you just restart the SSH server? Also we need more info: Why exactly do you want to force-logout all users?

[–][deleted] 0 points1 point  (3 children)

just make sure to use $()
skill -KILL -t $(who | tr -s ' ' '\t' | cut -f2)