Here is a few methods for killing tasks for a specific user in Linux which may be required during account deletion or because somebody has managed to be an idiot and locked himself out with a fork bomb or some such.
The simple method is to use the utility called 'slay' which for Debian / Ubuntu and most other distributions is available if its not install you can install it using 'apt-get install slay'
It is very simple to use. Just running the command slay
The other method to use when slay is not available is a combination of ps and kill. You can use the following command
kill -TERM `ps h --User nobody -o pid`
Understanding the above can other advantages as well because you can switch out the --User for --Group and kill processes by group id as well as for a specific user.
Did You find this page useful?
Thanks for the feeback. Please consider sharing with others.