Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to use su and sudo on my iMac that I did a fresh clean install of Mac OS X 10.9 and Server 3.0. I explicitly set the password for root with

passwd root

but when I try to use su or sudo from a local network account, it does not accept the password. When I was reading through some of the man pages for su, sudo and passwd, one of them (but I do not remember which) mentioned something about different behavior in an Open Directory environment. I tried digging around but could not find any more info.

Can anyone help me here?

share|improve this question

2 Answers 2

Mac uses Open Directory Services to manage passwords,

The commands you want are

launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
dscl . passwd /Users/username

Not as easy as linux, but that is because Apple assumes passwords will usually be set through the gui.

share|improve this answer

Is the account you trying to use su and sudo from an administrator? If not, neither will work. Also, sudo asks for the password of the account you are switching from, not the password of the account you are switching to. The normal way to get root access on a Mac is to use sudo from an admin account; since this does not require a root password, there's no reason to set one.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.