root可以杀死任何用户运行的任何程序.用户是否可以在不使用sudo等的情况下杀死其他用户的程序?
示例:如何使用户foo杀死由用户栏运行的程序x?
解决方法:
这是来自kill(2)
手册页:
For a process to have permission to send a signal it must either be privileged (under Linux: have
the CAP_KILL capability), or the real or effective user ID of the sending process must equal the
real or saved set-user-ID of the target process. In the case of SIGCONT it suffices when the send‐
ing and receiving processes belong to the same session.
所以基本上,在正常情况下,如果你不是root(并且无法成为root或其他用户,通过sudo或setuid程序),你就无法杀死另一个用户的进程.