OSX su command issue
Asked Answered
P

3

40

So I cant get su command to work on a terminal. All I do is type "su" and press enter, it asks for the password and I enter my currently logged in user password. It always gives this error. I swear this used to work earlier, not sure what happened.

su: Sorry

I am running a Mac OSX 10.7.1 (Lion). Anyone know what could be wrong? I am entering the right password.

Pliers answered 27/9, 2011 at 6:27 Comment(2)
I got it working, found it here - serverfault.com/questions/43362/su-not-working-on-mac-os-xPliers
You might want to turn your comment into an answer, then accept it. It proved useful to me.Extrusion
E
87
sudo su

will do the trick in Mac Os X terminal :)

Earthman answered 22/5, 2013 at 14:16 Comment(0)
M
11

There is no root account on mac osx. Just go sudo bash then type the command or commands you want as root.

Mockery answered 27/6, 2012 at 8:44 Comment(2)
-1. Of course there is a root account. "root" is shown as a file owner in many places. See Nehemias Herrera's correct answer below.Exequatur
did you mean "the root account is not enabled by default, you have to manually enable it to use it"? here: support.apple.com/kb/ht1528Thetic
S
1

If sudo stops working because permission to read sudoers is missing, this solution from kahisv.com solves the problem:

Check if the permissions are still correct, that's how it should be:

$ ls -lad / /private /private/etc
d--xrwxr-t+  36 root  wheel  1292 25 sty 12:34 /

If this is wrong in your case, boot in Single-User Mode (hold cmd+s while booting) and enter theese commands:

# /sbin/fsck -fy
# /sbin/mount -wu /
# /bin/chmod 1775 /
# /bin/sync
# exit
Synaesthesia answered 27/6, 2012 at 10:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.