Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Help! Having problems with su, sudo...

Help! Having problems with su, sudo...
Thread Tools
Akarso
Junior Member
Join Date: Nov 2001
Location: California
Status: Offline
Reply With Quote
Dec 7, 2001, 05:44 AM
 
While doing some customizing, i made a really dumb mistake. I accidentally chmod some apps in /usr/bin

now when ever i want to su, or sudo, i get the following message.

for su i get:

{akarso}@{localhost}:{/usr/bin}$su
su: setgroups: Operation not permitted
Password:

i then type in my password and then it displays "sorry" and then returns me to the prompt.

for sudo i get:{akarso}@{localhost}:{/usr/bin}$sudo
Sorry, sudo must be setuid root.

then returns me to the prompt.

I tried changing the permissions again, but i can't seem to get the right user/groups to make it work. Here are the current permissions

for su:
{akarso}@{localhost}:{/usr/bin}$ls -l su
-rwxr-xr-x 1 root wheel 14704 Sep 2 19:50 su

for sudo:
{akarso}@{localhost}:{/usr/bin}$ls -l sudo
-rwxr-xr-x 1 root wheel 107608 Sep 2 20:30 sudo


Any help would be really appreciated.
(oi)
     
Jelle Monkmater
Dedicated MacNNer
Join Date: Apr 2001
Location: World capital of drugs and prostitution. Hmmm... SEXTC...
Status: Offline
Reply With Quote
Dec 7, 2001, 06:13 AM
 
I don't know about su, but the sudo 'must be setuid root' is a dead giveaway: you've not got an 's-bit' set for sudo.

So howto:
Log in as root since you can't su or sudo, then

<font face = "courier">cd /usr/bin
chmod 4755 sudo</font>

This will set the permissions of sudo to -rwsr-x-r-x. What the 's' basically means is that your user ID will be set to whoever owns sudo (root) for the duration that sudo runs. It's similar to the permissions of passwd and ping.

As for su, I'm working on a different UNIX at work right now (AIX), and it's su is set -r-sr-x-r-x, which comes down to a

<font face = "courier">chmod 4555 su</font>

Have fun...

[ 12-07-2001: Message edited by: Jelle Monkmater ]
The one you love and the one who loves you are never the same person.
     
mmurray
Grizzled Veteran
Join Date: Sep 2000
Location: Adelaide, Australia
Status: Offline
Reply With Quote
Dec 7, 2001, 08:33 AM
 
Originally posted by Jelle Monkmater:
<STRONG>I don't know about su, but the sudo 'must be setuid root' is a dead giveaway: you've not got an 's-bit' set for sudo.

So howto:
Log in as root since you can't su or sudo, then

&lt;font face = "courier"&gt;cd /usr/bin
chmod 4755 sudo&lt;/font&gt;

This will set the permissions of sudo to -rwsr-x-r-x. What the 's' basically means is that your user ID will be set to whoever owns sudo (root) for the duration that sudo runs. It's similar to the permissions of passwd and ping.

As for su, I'm working on a different UNIX at work right now (AIX), and it's su is set -r-sr-x-r-x, which comes down to a

&lt;font face = "courier"&gt;chmod 4555 su&lt;/font&gt;

Have fun...

[ 12-07-2001: Message edited by: Jelle Monkmater ]</STRONG>
On my MacOS X I get

---s--x--x 1 root wheel 107608 Sep 3 13:00 sudo


hope that helps :-)

Michael
     
Jelle Monkmater
Dedicated MacNNer
Join Date: Apr 2001
Location: World capital of drugs and prostitution. Hmmm... SEXTC...
Status: Offline
Reply With Quote
Dec 7, 2001, 08:50 AM
 
Originally posted by mmurray:
<STRONG>

On my MacOS X I get

---s--x--x 1 root wheel 107608 Sep 3 13:00 sudo


hope that helps :-)

Michael</STRONG>
That would be <font face = "courier">chmod 4111 sudo</font>.
The one you love and the one who loves you are never the same person.
     
schwa
Mac Enthusiast
Join Date: Oct 1999
Location: Brooklyn, NY, USA
Status: Offline
Reply With Quote
Apr 3, 2002, 01:02 AM
 
I'm actually having a similar problem, but worse. I was re-installing mysql, and removed the mysql user from my system. For whatever reason, it had the effect of mangling su and sudo like above, but now all my system files are set to me as owner, not root.

What's the best way to go about restoring things the way they should be? Is there some script (wishful thinking) to aid this process?

TIA...
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 09:38 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,