How to run strace on setuid binaries like sudo?
Issue
-
During debugging session of issues wtih the
sudo
command for a non-root user there is a need to collectstrace
output for thesudo
command, so that the system calls can be investigated. -
Running
strace
onsudo
as a non-root user fails similarly to the following:$ strace -Tttfvyys 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 9
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.