Running Xubuntu 16.04.1 LTS 64-bit.

/proc/sys/kernel/yama/ptrace_scope keeps resetting to 1 if I reboot, despite me changing it to 0 manually. How can I keep ptrace_scope set to a value of 0?

2 Answers 2


/proc values are stored in RAM so it isn't persistent. But it read its initial values from a file. You can permanently change the value of /proc/sys/kernel/yama/ptrace_scope to 0 by editing the file /etc/sysctl.d/10-ptrace.conf and change the line:

kernel.yama.ptrace_scope = 1


kernel.yama.ptrace_scope = 0
  • Is any security risk attached to setting this permanently? Jun 25, 2018 at 18:59
  • 2
    Yes, there is some risks. You can view this post for more details [askubuntu.com/questions/146160/…
    – Dababi
    Jul 2, 2018 at 8:41
  • Well i showns how crazy the security boys have gotten. If you run a program under your user id it already can do enough damage.
    – Lothar
    Feb 27, 2021 at 18:22

In case the change doesn't reflect in /proc/sys/kernel/yama/ptrace_scope, try doing:

echo "0"|sudo tee /proc/sys/kernel/yama/ptrace_scope

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.