The system does not allow connecting debuggers to processes (Fedora, Red Hat)

The deny_ptrace boolean in SELinux, used by Fedora and Red Hat, only allows a process to attach to other processes that it has launched directly.

See https://fedoraproject.org/wiki/Features/SELinuxDenyPtrace for more details.

Solution

  • To disable this feature until the next reboot, run the following command:

    setsebool deny_ptrace 0
    
  • To disable this feature permanently, run this command:

    setsebool -P deny_ptrace 0
    

Note

From Fedora version 22 and later, ptrace might be blocked by Yama and also the SELinux boolean. See The system does not allow connecting debuggers to processes (Fedora, Ubuntu) for more information.