Hi
This is an easy solution.
In the PGDATA directory, by default on RHEL, /var/lib/pgsql/9.x/data (Where x is the minor version.
Edit the following file
pg_hba.conf
amend the line for local accordingly :-
local all all trust
Restart or reload postgres
Log into postgres using psql -U postgres
At the prompt type
ALTER USER postgres PASSWORD 'newpassword';
exit out of postgres \q
You can reset the pg_hba.conf , if you prefer.
Now the postgres superuser user (postgres) has the password of newpassword
Cheers
Tony