How to kill a process that says "Operation not permitted" when attempted?

161,655

Solution 1

try kill command with with -9 signal if sudo kill 'pid' does not work: sudo kill -9 2092

Solution 2

That command is running under sudo as root, your kill command must as well:

sudo kill 2092

Share:
161,655

Related videos on Youtube

jdl
Author by

jdl

Updated on September 18, 2022

Comments

  • jdl
    jdl over 1 year

    I have a process I would like to kill:

    computer@ubuntu:~$ ps aux | grep socat
    root      2092  0.0  0.0   5564  1528 pts/1    T    14:37   0:00 sudo socat TCP:xxx.17.29.152:54321 PTY,link=/dev/ttyGPS0,raw,echo=0,mode=666
    computer@ubuntu:~$ kill 2092
    -bash: kill: (2092) - Operation not permitted   <--------------- How to kill ??
    
    • Joel Taylor
      Joel Taylor over 10 years
      The command you list here is running as root. Have you tried running sudo kill 2092?
  • feedc0de
    feedc0de over 6 years
    I have a process that cannot be killed even with root (i'm running bash as root already). Any ideas what to try next?
  • Gr33n
    Gr33n over 6 years
    What process are you trying to kill and the error you are receiving?
  • feedc0de
    feedc0de over 6 years
    It is a stuck iftop and I get a "permission denied". Both iftop and kill are run by root itself. I started iftop from a bash and I can't kill that bash either.
  • Gautam
    Gautam almost 6 years
    there are times even kill -9 may not work.. then try sudo kill -9 pid
  • WestCoastProjects
    WestCoastProjects over 5 years
    I have a process in which I did sudo kill -9 2091 and it still gives this message. Why would that be (os/x high sierra)
  • jsky
    jsky almost 5 years
    It seems there are some processes that cannot be killed even like this. I cannot kill softwareupdated like this.