Reset Lost Password
If you have set the pi user password and either can't remember what you set or it doesn't work after reseting it, the only way to rebuild the password is to reboot the Raspberry Pi in a special mode so that you can set the password to what you want.
One way to do this is to insert the card into a Windows machine and change the cmdline.txt file.
Changing the cmdline.txt
Put the card in another machine and edit cmdline.txt on the fat partition. Add init=/bin/sh to the end of the line of text that it already has and save the file.
ExampleBefore it might look like:
Put the card back in the Pi and apply power. The system should start booting and then pretty quickly drop you at a command prompt.
Reset the pi User password
At this command prompt type:
(enter a new password)
The boot process will then continue and then pretty quickly drop you at a command prompt again.
Re-edit the cmdline.txt file in /boot and now remove the init=/bin/sh from cmdline.txt.
From that point on, when you reboot you should be able to use the new password you set for the pi user.