I know if I type w
I can get a list of all logged in users.
I also know that killall -u USERNAME
kicks all processes associated with the user USERNAME
(including bash / their shell, their sshd process, etc). As far as I know this is how you're supposed to "kick a user off" your server.
However I don't know how to kick off all users. Do I have to somehow w | cut -d' ' -f1
to get a list of users (and then somehow strip off the blank line and USER field and your own username) and feed that to the -u command for killall
?
Or is there a better way?
shutdown -h now
? ;)kick
? Something likekick tty pts/*
might come in handy…