+-
ubuntu – gdb附加权限问题(ptrace_scope是只读的)
使用gdb附加到进程时.表明

Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.

作为root我使用echo 0> / proc / sys / kernel / yama / ptrace_scope;
然后它显示:

bash: /proc/sys/kernel/yama/ptrace_scope: Read-only file system

我该如何解决这个问题?
/etc/sysctl.d/10-ptrace.conf的内容是kernel.yama.ptrace_scope = 0

最佳答案
在docker中,您现在可以使用–privileged选项,请参阅 https://docs.docker.com/engine/reference/commandline/exec/

docker exec --privileged -ti <container> bash

在特权模式下,gdb只是在不对ptrace_scope进行任何修改的情况下工作.

点击查看更多相关文章

转载注明原文:ubuntu – gdb附加权限问题(ptrace_scope是只读的) - 乐贴网