Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1736  / 1 Year ago, fri, january 13, 2023, 7:44:04

I want the members of a certain group to kill python.



pidof python | xargs kill



This is no problem when python has been started by themself. But when root has started a python process than the users of the group can't kill python.



I can fix this to allow the group members to use kill without password.



%nohup ALL=(root) NOPASSWD: /usr/kill



But now the group members can kill each process. I only want them to kill python.



How can I give permission to a group to kill only a specific proces that has been started by root?


More From » kill

 Answers
1

I would recommend writing a shell script that is allowed with NOPASSWD that simply contains the following:



#!/bin/bash
killall python
#pkill could also have been used

[#36614] Saturday, January 14, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
shadowoof

Total Points: 293
Total Questions: 112
Total Answers: 137

Location: Burkina Faso
Member since Sun, Nov 21, 2021
2 Years ago
;