Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 7069  / 2 Years ago, mon, may 30, 2022, 8:06:12

I am facing a strange problem while using a chroot'd 12.04 Ubuntu. When I try to run anything with sudo I get the following error:


sudo: effective uid is not 0, is sudo installed setuid root?

If I boot on the same system I'm "chroot'ing" to sudo works as expected. What can be the cause of this? How can I fix it?


Additional info:


[user@host /]$ ls -la /usr/bin/sudo
-rwsr-xr-x 1 root root 116928 12.05.2013 08:14 /usr/bin/sudo*

To chroot I used this: http://ubuntuforums.org/showthread.php?t=1156240


More From » sudo

 Answers
7

Having created a chroot from my current Ubuntu 12.04 installation by copying the necessary files I can confirm that the chroot + sudo actually works.



Now for your problem: there can be two solutions.




  1. You really don't have enough permissions on /usr/bin/sudo. This can be due to the actual permissions on the file or due to some filesystem mounting issues like nosetuid.


  2. Some kernel security module is blocking sudo / setuid bit within the chroot. This is less likely, but there are some security modules that can disable the setuid bit within a chroot.




If you want to debug this issue in detail, I suggest you get acquainted with strace, it will show you all the system calls the sudo command does and it'll help you debug what file or permission is causing the exact problem. I have written a tutorial on it, you might be interested in that.


[#31049] Wednesday, June 1, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
wenceslockro

Total Points: 494
Total Questions: 127
Total Answers: 97

Location: Chad
Member since Mon, Dec 5, 2022
1 Year ago
;