Resetting a Mac password.
If you are in receipt of an Apple Mac from eBay and you cannot get administrative access then there are a couple of ways to proceed.
If your Mac responds to Apple Button + R at boot-up (and by Boot-up we mean hold it down from the power-on sound until the progress bar/circle appears under the Apple logo) then you can simply select
Terminal from the utilities menu at the top of the screen and enter
resetpassword to choose a new password as if you were changing it within OS X as normal.
If the system does not respond to the commands then you need to use the terminal boot-up single sign-on to Linux method:
[list=1]
Access the single-user mode by holding the Command key and S on startup.Enter “mount –uw /” then press return.Enter “launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist” then press return.Enter “passwd [username]” then press return.Replace [username] with the name of your account.Reset your password.Type in “reboot” then press return.Log in with the new admin password.[/list]If you simply want to take the Mac back to defaults you can also re-run the initial set-up for first user wizard.
This is done using the same first two steps as above but once in Terminal,
[list=1]
Enter fsck -fyEnter mount -uw /Enter rm /var/db/.applesetupdoneEnter Reboot[/list]Now the Mac will see that set-up is incomplete and perform the first time logon wizard for a new user.