You can temporarily disable this restriction (and revert to the old behaviour allowing your user to ptrace (gdb) any of their other processes) by doing:
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
To permanently allow it edit /etc/sysctl.d/10-ptrace.conf and change the line:
kernel.yama.ptrace_scope = 1
To read
kernel.yama.ptrace_scope = 0
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
To permanently allow it edit /etc/sysctl.d/10-ptrace.conf and change the line:
kernel.yama.ptrace_scope = 1
To read
kernel.yama.ptrace_scope = 0
For some background on why this change was made, see the Ubuntu wiki
-----------
以上解决方法是从别的地方复制来的,至于出处我已经忘记了!!!