Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
why now "sudo: must be setuid root"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
genterminl
Apprentice
Apprentice


Joined: 12 Feb 2005
Posts: 283
Location: Connecticut, USA

PostPosted: Wed Mar 03, 2010 7:04 pm    Post subject: why now "sudo: must be setuid root" Reply with quote

I don't think it's been that long since I last used sudo, but today I get the "must be setuid root" error, and sure enough "ls -l /usr/bin/sudo" gives me "---x--x--x 2 root root 147632 Mar 3 13:12 /usr/bin/sudo" Reinstalling doesn't change this, and "eix app-admin/sudo" gives me " Installed versions: 1.7.2_p4(13:12:29 03/03/10)(pam -ldap -offensive -selinux -skey)"

I know I can do "chmod +s /usr/bin/sudo" but I'm curious whether this is indicative of some other problem.

Am I missing something obvious?


Jack
Back to top
View user's profile Send private message
ursusca
Apprentice
Apprentice


Joined: 10 Sep 2008
Posts: 277
Location: Toronto ON, CANADA

PostPosted: Wed Mar 03, 2010 7:14 pm    Post subject: Reply with quote

Hello,

Try this way:
Code:
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo

and reboot the machine.
_________________
You deserve free software!
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 2782

PostPosted: Wed Mar 03, 2010 9:52 pm    Post subject: Re: why now "sudo: must be setuid root" Reply with quote

genterminl wrote:
I don't think it's been that long since I last used sudo, but today I get the "must be setuid root" error, and sure enough "ls -l /usr/bin/sudo" gives me "---x--x--x 2 root root 147632 Mar 3 13:12 /usr/bin/sudo" Reinstalling doesn't change this, and "eix app-admin/sudo" gives me " Installed versions: 1.7.2_p4(13:12:29 03/03/10)(pam -ldap -offensive -selinux -skey)"

I know I can do "chmod +s /usr/bin/sudo" but I'm curious whether this is indicative of some other problem.

Am I missing something obvious?


Jack
On my system sudo is actually suid root.
Code:
---s--x--x 2 root root 162K Mar  3 13:40 /usr/bin/sudo
This is for both versions 1.7.2_p1 and 1.7.2_p4 (on two different systems).

@ ursusca genterminl already knows about how to change it to suid root: only worry is whether this is a security issue or not. According to my installation on two different machines it probably isn't.
_________________
emerge --quiet redefined | E17 vids: I, II
Back to top
View user's profile Send private message
papahuhn
Guru
Guru


Joined: 06 Sep 2004
Posts: 472

PostPosted: Wed Mar 03, 2010 9:56 pm    Post subject: Reply with quote

Well, if not suid root, how should sudo give root privileges?
_________________
Death by snoo-snoo!
Back to top
View user's profile Send private message
patrikas
Tux's lil' helper
Tux's lil' helper


Joined: 28 Nov 2009
Posts: 106

PostPosted: Wed Mar 03, 2010 10:04 pm    Post subject: Reply with quote

Make sure executable got overwritten when you reinstalled it. Are you using collision-protect or protect-owner features ?
Back to top
View user's profile Send private message
genterminl
Apprentice
Apprentice


Joined: 12 Feb 2005
Posts: 283
Location: Connecticut, USA

PostPosted: Wed Mar 03, 2010 10:26 pm    Post subject: Reply with quote

patrikas: the timestamp on sudo is the time I did the emerge today, so I'm pretty sure it did get the new copy.

ppurka: I'm not questioning whether making sudo setuid root is a security issue; I know that's how it is supposed to be. I'm wondering why mine is NOT setuid root, and whether that is indicating some other security issue.

It looks like this new version got installed Mar 1, so I'm assuming that's when the change happened, but if there was a problem with the ebuild, I would expect other people to have the problem also. I can easily fix my immediate problem - I'd just love to know why/how it happened.
Back to top
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1066

PostPosted: Thu Mar 04, 2010 12:26 am    Post subject: Reply with quote

ursusca wrote:
Hello,

Try this way:
Code:
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo

and reboot the machine.


This method absolutely does not require a reboot.
_________________
Game! - Where the stick is mightier than the sword!
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5077
Location: France, Old Europe

PostPosted: Fri Mar 19, 2010 7:25 am    Post subject: Reply with quote

That's odd , my windows machine says it needs to reboot every time I change anything. Isn't Linux the same ?
:P
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.

KX7-333 , AthlonXP1800+ @2.3GHz
AthlonXP-M on A7N8X @ 2.6/2.4GHz (winter/summer)
2.6.32-hh1 : portage ~x86
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 8690
Location: beyond the rim

PostPosted: Mon Mar 22, 2010 1:57 am    Post subject: Reply with quote

Do you eventually use the suidctl and/or sfperms FEATURES in make.conf?
Back to top
View user's profile Send private message
genterminl
Apprentice
Apprentice


Joined: 12 Feb 2005
Posts: 283
Location: Connecticut, USA

PostPosted: Mon Mar 22, 2010 2:54 am    Post subject: Reply with quote

Great question - but no, I don't use either of those. I didn't even know about them until your post.
Back to top
View user's profile Send private message
M
Guru
Guru


Joined: 12 Dec 2006
Posts: 414

PostPosted: Mon Mar 22, 2010 7:31 pm    Post subject: Reply with quote

It happens to me, often, when I mount over nfs old laptop on desktop machine and update sudo or xorg-server, always have to manually setuid. And I have rpc.idmapd started. Maybe you use something similar, just a guess.
Back to top
View user's profile Send private message
genterminl
Apprentice
Apprentice


Joined: 12 Feb 2005
Posts: 283
Location: Connecticut, USA

PostPosted: Mon Mar 22, 2010 7:58 pm    Post subject: Reply with quote

The only thing close is that PORTAGE_TMPDIR points to a directory mounted over NFS. /usr is within / which is a local mount.
Back to top
View user's profile Send private message
genterminl
Apprentice
Apprentice


Joined: 12 Feb 2005
Posts: 283
Location: Connecticut, USA

PostPosted: Mon Jan 30, 2012 5:35 pm    Post subject: Reply with quote

I just upgraded sudo (now 1.8.2-r1) as part of a recent world update, and again, /usr/bin/sudo got installed WITHOUT suid set. Lot's of googling, and no answers, except one hint buried in this topic.

If I emerge sudo with PORTAGE_TMPDIR set to a local disk, /usr/bin/sudo gets installed setuid.
If I emerge sudo with PORTAGE_TMPDIR set to an nfs4 mount, /usr/bin/sudo gets installed without setuid.

This is yet another problem with PORTAGE_TMPDIR on an nfs4 mount, but at least I know why the setuid isn't happening.

This was my original post on the issue. I'll probably start a new thread summarizing my current understanding, but the bottom line is that setting PORTAGE_TMPDIR to someplace mounted over nfs4 is going to cause various problems, not all of them consistent.
Back to top
View user's profile Send private message
mcclung
n00b
n00b


Joined: 24 Apr 2005
Posts: 9

PostPosted: Tue Jan 31, 2012 1:22 am    Post subject: nfs Reply with quote

What are the export and mount options on your nfs filesystem? What kind of NFS server is it?
Back to top
View user's profile Send private message
genterminl
Apprentice
Apprentice


Joined: 12 Feb 2005
Posts: 283
Location: Connecticut, USA

PostPosted: Wed Feb 01, 2012 3:11 pm    Post subject: Reply with quote

First, if I remember correctly, using nfs3 does not cause any of these problems, but at this point, I'm trying to find the cause, not just make it work.
The nfs server (ffortso3) is Ubuntu 11.10. The relevant lines from /etc/export are
Quote:
/exports ffortso?.home(fsid=0,rw,sync,root_squash,no_subtree_check)
/exports/portagetmpdir ffortso?.home(fsid=1,rw,async,no_root_squash,no_subtree_check)
and the relevant line from /etc/fstab is
Quote:
/home/portage/tmpdir /exports/portagetmpdir none bind 0 0

The client (ffortso4) is Gentoo, and /etc/fstab includes
Quote:
ffortso3:/portagetmpdir /home/portage/tmpdir nfs4 nocto 0 0
and /proc/mounts shows (note I have added spaces after each comma to improve wrapping, but it is really one line)
Quote:
ffortso3:/portagetmpdir/ /home/portage/tmpdir nfs4 rw, relatime, vers=4, rsize=131072, wsize=131072, namlen=255, hard, nocto, proto=tcp, port=0, timeo=600, retrans=2, sec=sys, clientaddr=192.168.1.14, minorversion=0, local_lock=none, addr=192.168.1.13 0 0

The "nocto" is just another of my attempts to see if I can find a parameter to avoid all the problems, but I'm still getting th errors. Adding either "ac" or "lookupcache-none" made both machines unbearably slow, and at this point, I'm not even sure if they actually fixed the problems. "acregmax=0" also didn't help.

Any other suggestions?
Back to top
View user's profile Send private message
mcclung
n00b
n00b


Joined: 24 Apr 2005
Posts: 9

PostPosted: Thu Feb 02, 2012 4:00 am    Post subject: Reply with quote

I was expecting something else. In hindsight, I guess what I was looking for would have been pretty obvious.
Back to top
View user's profile Send private message
genterminl
Apprentice
Apprentice


Joined: 12 Feb 2005
Posts: 283
Location: Connecticut, USA

PostPosted: Thu Feb 02, 2012 1:31 pm    Post subject: Reply with quote

For completeness, I suppose I should also specify that I do have idmapd running, with the same domain specified on both machines.
Back to top
View user's profile Send private message
myk002
n00b
n00b


Joined: 06 Mar 2012
Posts: 2

PostPosted: Tue Mar 06, 2012 6:41 pm    Post subject: strip is the culprit Reply with quote

after struggling with this for a few days, I accuse 'strip' as the culprit.

# emerge sudo
# ls -l /usr/bin/sudo
---x--x--x 2 root root 71144 Mar 6 10:32 /usr/bin/sudo
# FEATURES=nostrip emerge sudo
# ls -l /usr/bin/sudo
---s--x--x 2 root root 84221 Mar 6 10:34 /usr/bin/sudo
# strip /usr/bin/sudo
---x--x--x 2 root root 71256 Mar 6 10:32 /usr/bin/sudo

I have a diskless system, with everything (including root) mounted over nfs (version 3). Interestingly, though, /bin/mount (from util-linux-2.20.1-r1) is correctly setuid, even though it gets stripped.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum