PostgreSQL on Mac OSX - cannot log in as postgres user
-
28-10-2019 - |
Question
I installed postgresql and geodjango on Mac OSX following this tutorial word for word. For some reason
sudo su - postgres
does not work. I put in my sudo password, but when I type "whoami" it's still my normal user login.
I know there is postgres user after I saw the list from
dscl . -list /Users UniqueID
Any idea why this is happening? I installed PSQL 9.1.1 server version.
Thank you.
Solution
The postgres account probably has disabled login rights and/or /bin/false as the login shell.
In this case you had best invoke postgresql commands directly, eg: sudo -u postgres psql
That should work even with a disabled login shell.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow