Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

OutThere

macrumors 603
Original poster
Dec 19, 2002
5,730
3
NYC
So I forgot my password today, and I didn't have my install CDs, and, really needing my computer, I decided to figure out how to fix it all on my own. :cool:

Basically you create another admin account, which really is far too easy to do, but here we go:

(Remove all quotes before typing the commands I put here)

1) Start up in Single-User mode by holding Apple+S at startup...the screen will go black and be covered in white text.

2) Type "/sbin/fsck -y", hit return, then type "/sbin/mount -wu /"

3) Once you have the prompt again type "cd /var/db/"

4) The prompt will change slightly. Then type "ls" and verify that somewhere in the table of items there is the file: ".AppleSetupDone"

5) Making sure that this file is there, then you can delete it by typing "rm ./.AppleSetupDone" or move it to the root of your hard drive for safekeeping by typing "mv ./.AppleSetupDone /"

6) Once it is no longer in place, type "reboot" and the computer will restart...and the first-run video will play and prompt you to register. You don't have to fill any of this in, you can just press Apple+Q, confirm the dialog, and you'll be presented with a page where you set up a new admin account. Put in whatever you want, log in, and you can change the password on your main account. :)

If you're ever in a fix, being able to do this can be very helpful.
 

ElectricSheep

macrumors 6502
Feb 18, 2004
498
4
Wilmington, DE
You can safely just delete the .AppleSetupDone file since it is little more than the plist of the registration information you fill out when you finish creating your account for the first time.
 

OutThere

macrumors 603
Original poster
Dec 19, 2002
5,730
3
NYC
ElectricSheep said:
You can safely just delete the .AppleSetupDone file since it is little more than the plist of the registration information you fill out when you finish creating your account for the first time.

The only reason that I felt people might want to save it was if they didn't want to have to put their info back in. If they just moved the file back to where it was before after making a new account then they would have their registration info stored right on their computer without having to put it all back in. :)
 

Koodauw

macrumors 68040
Nov 17, 2003
3,951
190
Madison
Wow, this is pretty darn cool. Perhaps you should send this to Apple. I dont think its a real big security flaw, because most people wouldnt be able to do this, but its kinda nice to know.
 

Benjamin

macrumors 6502a
Oct 27, 2003
959
1
Portland, OR
Nice find, I don't think it is that serious of a flaw, might want to send it to apple, but seeing you have to be physically at the computer to do this... anywho.. just for clarification it isn't super user start up but single user mode when you apple + s.
 

Koodauw

macrumors 68040
Nov 17, 2003
3,951
190
Madison
Seeing as this thread is almost 2.5 years old and when it was posted I think Tiger was the OS du jour, can anyone confirm this still works with Leopard?
 

Xavier

macrumors demi-god
Mar 23, 2006
2,796
1,531
Columbus
Ya, i did this awhile back in Tiger when I was in a similar situation.

Since then I have remembered my passwords
 

chagla

macrumors 6502a
Mar 21, 2008
797
1,727
wow!
resetting windows admin password takes some more efforts!
but then i thought Windows was less secure.;)
 

WilWheaton

macrumors member
Feb 21, 2008
33
0
Apple likes to boast security, while at the same time, making it so users don't brick their installs when the less technically inclined forget their password. It's really impossible to have both without some compromises. Personally, I find most of apples claims of security (besides the actual internal structure of the OS) a joke in how things are presented to the user by default (no encryption options for time machine, general openness to ease of use over security), but that's besides the point here.

If the fact that people can do this worries you, look into enabling the open firmware password which can't be changed without some hardware intervention, and is independent from the operating system. I personally would never run a laptop without the open firmware password enabled. Details on how to set it up are here http://support.apple.com/kb/HT1352

Unfortunately it's still a joke in the end, all you need to do is change the size of ram in the machine (by taking a stick out) and hold down the appropriate buttons to reset the pram while the machine is booting up.

edit -- I'm pretty sure this hasn't changed with leopard. It's actually more under a 'feature' than a flaw :/
 

GFLPraxis

macrumors 604
Mar 17, 2004
7,152
460
To the people worried about security:
It's a generally accepted fact that, barring an encrypted drive, if someone has physical access to your machine, they can hack it. Doesn't matter what OS.

So I only care about security from outside intrusions. If someone has physical access to my machine and know what they're doing, they can hack it.
 

chagla

macrumors 6502a
Mar 21, 2008
797
1,727
Seeing as this thread is almost 2.5 years old and when it was posted I think Tiger was the OS du jour, can anyone confirm this still works with Leopard?
lol.
it works on leopard too. i just did it. :rolleyes:

guess i'm gonna go back to Suse Linux.
 

26139

Suspended
Dec 27, 2003
4,315
377
Yep

To the people worried about security:
It's a generally accepted fact that, barring an encrypted drive, if someone has physical access to your machine, they can hack it. Doesn't matter what OS.

So I only care about security from outside intrusions. If someone has physical access to my machine and know what they're doing, they can hack it.

Exactly. Very few computers need to protect against someone with physical access, as the data on them, while important no doubt to the owner, isn't all that of a big deal.

Cool password trick, though.
 

sayiwonttdcs

macrumors newbie
Sep 25, 2009
1
0
Emac will not reboot after Walkthrough

I acquired some ~2005 era emacs to set up for the teacher across the hall from me at my hs . When trying to create the new user account to gain admin access, the computer will no longer reboot. Ive followed the online walkthrough and the first emac I attempted this on worked. The next two will restart and ask to set the main language. then will remain on a blue (changing with occasional cursor) screen indefinitely. I don't know what info you will need to help, but ill give you the mac's reactions to the commands:

1) Start up in Single-User mode by holding Apple+S at startup...the screen will go black and be covered in white text.
check

2) Type "/sbin/fsck -y", hit return,
** /dev/rdisk0s3
** Root file system
** Checking HFS Plus Volume
fsck_hfs: Volume is journaled. No checking performed.
fsck_hfs: Use the -f option to force checking.

when Force checked, it runs through a list and the final msg states
**The volume Macintosh HD appears to be OK.


then type "/sbin/mount -wu /"

HFS: Removed 1 orphaned unlinked files

3) Once you have the prompt again type "cd /var/db/"
4) The prompt will change slightly. Then type "ls" and verify that somewhere in the table of items there is the file: ".AppleSetupDone"
5) Making sure that this file is there, then you can delete it by typing "rm ./.AppleSetupDone" or move it to the root of your hard drive for safekeeping by typing "mv ./.AppleSetupDone /"


As i reenter the list there is no applesetupdone file
the list reads:
.2z694-5176 ColorEquivalenceCandidates crashdump openldap
.AppleCustomMac CodeEquivalenceDatabase crls samba
.AutoBindDone RemoteManagement dhcpclient shadow
.RunLanguageChooserToo Spotlight-V100 dlyd statd.status
.com.apple.iokit.graphics SystemEntropyCache loginwindow.boottime volinfo.database BootCache.playlist SystemKey netinfo


6) Once it is no longer in place, type "reboot" and the computer will restart...and the first-run video will play and prompt you to register. You don't have to fill any of this in, you can just press Apple+Q, confirm the dialog, and you'll be presented with a page where you set up a new admin account. Put in whatever you want, log in, and you can change the password on your main account.


Never gets past the select main language dialogue....

I have attempted some other fixed i found online and nothing has remedied the problem. Thank you very much for your help.

-Ryan
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.