Itzik T.'s picture

Need help to resolve connection problem to postgres DB (LAPP Appliance) using psql  or python code (vscode + PostgreSQL extension Ver 0.3.0)

When running  "psql -U postgres -h localhost" (using terminal & postgres password)
- received an Error msg :
psql: error: FATAL:  password authentication failed for user "postgres" 
FATAL:  password authentication failed for user "postgres"
 
e.g.
postgres password is correct - cause I'm able to connect to Postgres Server (Lapp)  & Postgres DB using web control panel (Adminer / Webmin) using my postgres password (include select data from DB tables)
 
Configuration:
Host os:            Linux Mint 20 Cinnamon (Kernel 5.4.0-58-generic)
psql --version : psql (PostgreSQL) 12.5 (Ubuntu 12.5-0ubuntu0.20.04.1)
Vbox :              ver 6.1 (networking: Bridged adapter)
turnkey App. : LAPP  - ( turnkey-lapp-16.0-buster-amd64.ova)
 
Itzik.
Forum: 
Tags: 
Jeremy Davis's picture

Apologies for such a slow response, I've been away from my desk...

PostgreSQL default user uses socket authentication, so when you using via CLI, you don't need to use the password if you su as the user. I.e. you should be able to issue commands like this (with no password required):

su - postgres -c "psql COMMAND GOES HERE"

If you wish to access PostgreSQL remotely though, you need to make PostgreSQL listen for remote connections, plus allow remote connections too. You can find how to do that in the docs.

I hope that helps...

Itzik T.'s picture

Jeremy !

Thank's for your help 

meanwhile (cause I need  to use database) I resolve my problem by using the Turnkey Postgres applince

(turnkey-postgresql-16.0-buster-amd64)  and everything works perfectly

Itzik T.

Jeremy Davis's picture

Yes the standalone PostgreSQL appliance has remote connections enabled by default. FWIW we figure that most users would expect remote connections to "just work" OOTB in the standalone appliance. Because of that, it's much less likely to be a security risk without value as it may be on other apps in our library.

Enabling/disabling remote connections is probably a good Confconsole plugin candidate though?!

Add new comment