There are two methods :
1.Login as single user method and change the user password or root password(if bootloader is not having as password)
Step 1: Power up the machine.
Step 2: When the GRUB boot loader starts, select "e" to edit the configuration. Select the kernel config line. Instead of adding "1 " or "single" to the end of the line aka Red Hat, add this instead:
Step 3: Hit "b" to boot the system.
Step 4: When the system boots and brings you to a command prompt, type this command to mount the root file system: " mount / -o remount,rw"
Step 5: Now you can change the password by typing "passwd" followed by your username, then hit enter. Follow the prompts to change the password for your regular username (not root).
Step 6: Unmount the file system: "mount / -o remount,ro"
Step 7: Now type "sync", hit enter, then type "reboot".
Step 8: After your system boots you should find yourself at the login screen, only this time you can log in with your new password!
2.Use rescuse cd/dvd to reset the password