forgot passwords for postgresql users. how do I login?

To change the password of any linux user, including the Postgres root:

sudo passwd postgres

Then:

su - postgres
psql -U postgres template1 -c alter user postgres with password 'newpassword';