Update April, 2014: On newer versions of OSX, the original advice (below) no longer applies. "Newer versions" here means at least 10.8 and 10.9. It should apply to any version of OSX with a dedicated recovery partition though.
Here's the newer way to do this:
- Boot the system into recovery mode. To do this, reboot and hold down Command and the 'r' key at the same time.
- Launch a terminal and enter
- This will launch a window. From there, you can choose what user you want to reset the password for (including root, if you've enabled root).
The article that John links to suggests that you use the installer disc to repair a lost admin password, but since you mention that you're far from an installer disc, I will mention that there is an old Unix hack available. (Edit: Just to clarify, once upon a time there was another answer here that linked to this Apple support page. I still think that's a useful page to have linked as part of this discussion, so I'm putting it into this answer. Also, I don't want anyone thinking I imagined another answer.)
Boot the system into single-user mode. To do this, reboot and hold down Command and the 's' key at the same time. You're going to get a black screen and a lot of text. Don't freak out.
Mount the root volume by entering this (this command should be mentioned near the bottom of all the text you see as well):
/sbin/mount -uw /
(Edit: Read all the way to the end for an alternative approach here.)
Change your root user's password by entering
passwd (no 'o' and no 'r'). It will prompt you to enter a password twice. Remember this one.
exit to boot the rest of the way into the normal pretty Mac GUI.
Open a terminal, enter
su and your new root password.
passwd <name-of-user-here> but, you know, put the name of the user whose password you want to change, instead of
Change that user's password. Enter
exit to drop the superuser status and powers. Enjoy your new password.
Note that many modern Unix-like distros block this "reset the root user password without knowing the old one" hack, but I just did it on the Mac I'm at (a brand new MacBook Pro). So, apparently, Mac hasn't blocked it. That's too bad in general, but perhaps good for you and your friend.
Edit: Some people have mentioned in the comments that you can skip resetting the root password and simply reset the user's password. To do that, at step 3 above enter
passwd <name-of-user-here> and then enter a new password for the user. If you do that, you can skip steps 5-7. Just follow step 4 to boot into the GUI and you're done.
This is a good alternative if that user was an administrator for the machine. However, if the user was not an admin for the machine, you should make sure to reset an admin's password as well (or to reset a root password as I did above). You can repeat
passwd <name-of-user-here> as many times as you need for various users. Just make sure to reset at least one account that has admin privileges. That way you have not only a user's password, but administrative access to the machine.