No help to me as to change a password in user groups and selecting the correct user one has to remember the old password which is the problem in the first place CANT REMEMBER PASSWORD
"For OS X Mavericks (10.9), Mountain Lion (10.8), and Lion (10.7) with Recovery Mode:
Boot into the Mac OS X boot loader menu by holding down the OPTION key at system start
Choose the Recovery drive to boot into recovery mode and wait until the “Utilities” screen appears
Pull down the “Utilities” menu and choose “Terminal”
At the command line, type “resetpassword” without the quotes
Confirm the new account password, then reboot the Mac as usual"
If that password screen is a simple window showing a padlock, then that sounds like you have a firmware password set, which will also prevent you from booting to the Recovery partition (which will show you a window with several choices, such as Disk utility, and Reinstall OS X)
If you simply get the box, with padlock, asking for you password - if your Mac is less than about 3 years old, then you have to call Apple, or take your iMac to an Apple store Genius, as that's the only way to clear the password.
more info about that - http://support.apple.com/kb/TS3554
When you boot while holding down both command-r, do you get this screen? If that is what you are seeing there is a firmware lock on your machine and you will need to take it to Apple with proof of ownership to get it removed.
Otherwise, the procedure Bruno described will work.