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.

kapso
  • 11,703
  • 16
  • 58
  • 76
  • 1
    I got it working, found it here - http://serverfault.com/questions/43362/su-not-working-on-mac-os-x – kapso Sep 27 '11 at 06:43
  • You might want to turn [your comment](http://serverfault.com/q/43362/58481) into an answer, then accept it. _It proved useful to me._ – Marius Butuc Jun 28 '12 at 15:49

3 Answers3

87
sudo su

will do the trick in Mac Os X terminal :)

Nehemias Herrera
  • 1,751
  • 1
  • 14
  • 12
11

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

Thiem Nguyen
  • 6,345
  • 7
  • 30
  • 50
jacklol
  • 191
  • 1
  • 3
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
schluchc
  • 3,924
  • 2
  • 15
  • 13