On Wed, Dec 27, 2023 at 12:39:26AM +0000, Albretch Mueller wrote: > I am getting an "Operation not permitted" error while strace tries to > attach to that pid: > > "strace: attach: ptrace(PTRACE_SEIZE, 52527): Operation not permitted" > > > $ ping www.google.fr -c 4 & > pid=$! > strace -p "$pid" > wait "$pid"
Yeah, even on Debian systems where ping isn't setuid root, it still seems to need special capabilities that strace interferes with, or isn't allowed to attach to, or something. unicorn:~$ strace -o log ping www.debian.com -c 4 ping: socktype: SOCK_RAW ping: socket: Operation not permitted ping: => missing cap_net_raw+p capability or setuid? So, pick something other than ping, or run the strace as root.