5 ms·
I tried this on Ubuntu 22.04.1 and got an error: $ reptyr 10330
by _kst_ 4y ago
I tried this on Ubuntu 22.04.1 and got an error:
$ reptyr 10330
Unable to attach to pid 10330: Operation not permitted
The kernel denied permission while attaching. If your uid matches
the target's, check the value of /proc/sys/kernel/yama/ptrace_scope.
For more information, see /etc/sysctl.d/10-ptrace.conf
$
I haven't (yet) looked into how to fix or work around this problem.
- LooseMarmoset 4y agowere you root?
- _kst_ 4y agoNo, I wasn't root.
- tyingq 4y agoEither, as root: # echo 0 > /proc/sys/kernel/yama/ptrace_scope or permanently by editing the file /etc/sysctl.d/10-ptrace.conf
- metadat 4y agoWhat are the costs and / or downsides to enabling prace_scope?
- ollien 4y agohttps://askubuntu.com/a/153970 https://askubuntu.com/a/153970 > What are the risks in setting ptrace_scope to 0? > - This restores the old behavior where one process can "trace" another process, even if there is no parent-child relationship. > - In theory, a piece of malware can use this to harm you/your computer; e.g. it can attach to Firefox and log all of your URLs/passwords, etc. In practice this is extremely unlikely unless you blindly install binary debs from random sites, etc. > - As far as debugging goes, the 0 settings is in fact required for gdb, strace, etc. to attach to non-children unless you run them with elevated privileges (sudo).