DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 3 Weeks Ago
CiotBSD CiotBSD is offline
c107:b5d::
 
Join Date: Jun 2019
Posts: 25
Default [6.6] Postresql error on auth

Hi all

I've a problem with postgresql when attemp to auth new user.

FYI: I start completely with Postgresql. Usually I use MySQL*
Postgresql has just been installed.

Error message:
Code:
psql: FATAL:  password authentication failed for user "***"
----

Demo:

Code:
srvr# su - _postgresql
srvr$ psql -U postgres
Password for user postgres:
psql (11.5)
Type "help" for help.

postgres=# CREATE USER ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2 WITH PASSWORD
'6TsrKeqq93KyVtc5yVjU9dfZsJkPPtKKdSyEnjypZDkVdgtW4aVN3YNQd5vKoFNx';
CREATE ROLE
postgres=# \connect template1
You are now connected to database "template1" as user "postgres".
template1=# CREATE DATABASE "A5mSHO4SamFa2OJmJC81GbDtUhj4wkyU2" WITH
ENCODING 'UTF-8';"
CREATE DATABASE
template1"# GRANT ALL PRIVILEGES ON DATABASE
"A5mSHO4SamFa2OJmJC81GbDtUhj4wkyU2" TO ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2;
template1"# ALTER DATABASE "A5mSHO4SamFa2OJmJC81GbDtUhj4wkyU2" OWNER TO
ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2;
template1"# \q
Use control-D to quit.
template1"# \q
srvr$ exit
In fact, I have one created user, named ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2
His password:
6TsrKeqq93KyVtc5yVjU9dfZsJkPPtKKdSyEnjypZDkVdgtW4a VN3YNQd5vKoFNx
One created DB, named:
A5mSHO4SamFa2OJmJC81GbDtUhj4wkyU2

And the user ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2 has all rights on DB
A5mSHO4SamFa2OJmJC81GbDtUhj4wkyU2

Right?!

But, when I attempt to connect to DB with user, I have the above the error message:
Code:
# psql -U ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2
Password for user ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2:
psql: FATAL:  password authentication failed for user
"ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2"

# psql -U ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2 -d
A5mSHO4SamFa2OJmJC81GbDtUhj4wkyU2
Password for user ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2:
psql: FATAL:  password authentication failed for user
"ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2"
Ok I found it's necessary to change informations into file 'pg_hba.conf'. I set as:
Code:
# grep A5mSHO4SamFa2OJmJC81GbDtUhj4wkyU2 /var/postgresql/data/pg_hba.conf
local A5mSHO4SamFa2OJmJC81GbDtUhj4wkyU2 all        trust
And restart the service/daemon postgresql.

Despite, I cant connect on!

---

Any idea?

FYI: I posted this issue, today, on list @misc.
Reply With Quote
  #2   (View Single Post)  
Old 3 Weeks Ago
fvgit's Avatar
fvgit fvgit is offline
Spikes in tights
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("U2hlcndvb2QgRm9yZXN0")'
Posts: 203
Default

I'm not an expert, but I think your problem could be the following:

Quote:
# If you run psql without a database name as an option, it tries to
# connect to a database with the same name as the $USER psql runs as.
Your command should therefore be:

Code:
 psql -U ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2 A5mSHO4SamFa2OJmJC81GbDtUhj4wkyU2
Edit: Damn, I just realised you already tried that. In that case I'm out of ideas.

Last edited by fvgit; 3 Weeks Ago at 07:27 PM.
Reply With Quote
  #3   (View Single Post)  
Old 3 Weeks Ago
CiotBSD CiotBSD is offline
c107:b5d::
 
Join Date: Jun 2019
Posts: 25
Default

On the list misc@, the reply is:

- the good command to create with LOGIN to permit connexion, as:
Code:
CREATE USER ghiMDQawgogUfFRTikPoWsUFN1xX8bgz2 WITH LOGIN PASSWORD
'6TsrKeqq93KyVtc5yVjU9dfZsJkPPtKKdSyEnjypZDkVdgtW4aVN3YNQd5vKoFNx';
and using lower letter…
Code:
CREATE USER username WITH LOGIN PASSWORD 'mybeautifull4password';

Last edited by CiotBSD; 3 Weeks Ago at 05:27 PM.
Reply With Quote
Reply

Tags
auth, error, openbsd, postgresql

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nginx w/ basic auth fails due to permissions ed.n1n2 OpenBSD General 6 24th June 2016 02:06 AM
openvpn-auth-ldap on openbsd 4.7 jespada OpenBSD General 2 26th August 2010 09:05 PM
Courier IMAP/POP3 can't auth to mysql db revzalot OpenBSD Packages and Ports 5 6th September 2009 05:44 AM
Smtp Auth Help needed roundkat OpenBSD General 4 8th May 2009 08:25 PM
Problem with Postfix and Sasl auth unixbsd OpenBSD General 1 27th April 2009 03:26 AM


All times are GMT. The time now is 09:46 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick