I setup posgresql on centos. I'm trying to access it but I receive an error:
sudo -u postgres psql -c "ALTER USER john WITH PASSWORD 'mypass';"
[sudo] password for john:
could not change directory to "/home/john"
ALTER ROLE
psql -h localhost -U john -d proddb -W
Password for user john:
psql: FATAL: Ident authentication failed for user "john"
I've listed the users with 'du' and know that john is a superuser. Can someone tell me why this is happening and how to fix it?