How to run strace on setuid binaries like sudo

Solution Verified - Updated -

Issue

  • During debugging session of issues wtih the sudo command for a non-root user there is a need to collect strace output for the sudo command, so that the system calls can be investigated.

  • Running strace on sudo as a non-root user fails similarly to the following:

$ strace -Tttfvxyys 4096 -o sudo-strace.txt sudo -i
sudo: effective uid is not 0, is /bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.