5

I am currently trying to create a root account from Single User Mode on OSX Yosemite

/sbin/mount -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist
passwd

The first 2 lines appear to work fine, but after I type 'passwd' nothing comes up. Not even a propmpt to keep typing commands. I don't believe it is setting the password because anything I type is visible and even if I type the same text twice nothing happens.

When I try to run this command after the computer boots and I have logged into my account 'passwd' works as expected, it prompts me for the old password and for the new password twice.

mucle6
  • 645
  • 1
  • 10
  • 24
  • 1
    Single user mode may need absolute paths – uchuugaka Mar 22 '15 at 23:31
  • how would I change my code to use absolute paths? – mucle6 Mar 22 '15 at 23:44
  • well, you notice /sbin/mount right? That is an absolute path. – uchuugaka Mar 23 '15 at 06:17
  • according to my terminal, which passwd says that tool is at /usr/bin/passwd – uchuugaka Mar 23 '15 at 06:18
  • at the very least, you might want to consider using which to find locations if they might be tools that change or could be customized. but again, there is no PATH variable set for the single user mode, so you need to use absolute paths or provide the paths somehow – uchuugaka Mar 23 '15 at 06:20
  • Absolute path doesn't solve the issue for me. Any ideas? – rightaway717 Jul 07 '16 at 11:05
  • I don't believe I ever got this working. My solution was deleting the setup done file, allowing me to set up a new account and then using the terminal on that new account I could make the root account. If you figure out how to do this in single user mode I would be interested to hear the solution. – mucle6 Aug 09 '16 at 17:51

1 Answers1

0

I had exactly the same issue, earlier today. However, there is another way:

Reboot your Mac then press & hold Command + R when it's booting up until you see a loading bar. You'll then be taken into recovery mode.

Recovery mode has a UI, so use your mouse and select Terminal from the Utilities section of the menu bar.

Type resetpassword in the terminal and hit Enter. This will load the password reset utility, where you can pick a user and give them a new password.

parad1gm
  • 460
  • 3
  • 8