Thread: psql security fail?

psql security fail?

From
Maxy
Date:
Good morning, i have a pg_hba.conf =0A=0Alocal=A0=A0 all=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 md5=0Ahost=A0=A0=
=A0 all=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0 127.0.0.1/32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 md5=0A=0A=0Aif i do=
 a =0A=0A=0Apsql -d mydb=0A=0Apg asks me the password but if i do=0A=0Apsql=
 -U postgresql -d mydb=0A=0Apg don't ask me the password.=0APostgreSQL 9.2.=
4 on i686-pc-linux-gnu, compiled by gcc (GCC) 4.7.1, 32-bit=0A=0Ai did some=
 tries, and the same configuration and the same source =0Acompiled on slack=
ware arm 14.0 on a raspberry works without the bug.=0A

Re: psql security fail?

From
Tom Lane
Date:
Maxy <maxy0440yxam@yahoo.it> writes:
> Good morning, i have a pg_hba.conf
> local   all             all                                     md5
> host    all             all             127.0.0.1/32            md5

> if i do a

> psql -d mydb

> pg asks me the password but if i do

> psql -U postgresql -d mydb

> pg don't ask me the password.

Sounds to me like Postgres isn't actually using the pg_hba.conf file you
think it is.  Try "show hba_file;" while connected to see which file
is really being used.  Also, if you changed the file's contents, you might
have forgotten to restart or SIGHUP the postmaster to get it to notice
the change.

            regards, tom lane

I: psql security fail?

From
Maxy
Date:
=0A=0A>Sounds to me like Postgres isn't actually using the pg_hba.conf file=
 you=0Athink it is.=A0 Try "show hba_file;" while connected to see which fi=
le=0Ais really being used.=A0 Also, if you changed the file's contents, you=
 might=0Ahave forgotten to restart or SIGHUP the postmaster to get it to no=
tice=0Athe change.=0A=0Ano, i verified and hba_file is correct, and i have =
restarted the system.=0Ai'm very worried.=0A

Re: I: psql security fail?

From
Alvaro Herrera
Date:
Maxy wrote:
>
>
> >Sounds to me like Postgres isn't actually using the pg_hba.conf file you
> think it is.  Try "show hba_file;" while connected to see which file
> is really being used.  Also, if you changed the file's contents, you might
> have forgotten to restart or SIGHUP the postmaster to get it to notice
> the change.
>
> no, i verified and hba_file is correct, and i have restarted the system.
> i'm very worried.

Do you have other uncommented lines in pg_hba.conf other than those you
pasted?

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

I: I: psql security fail?

From
Maxy
Date:
>Do you have other uncommented lines in pg_hba.conf other than those you=0A=
=0Apasted?=0A=0ANo, this is the pg_hba =0A=0Alocal=A0=A0 all=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 md5=0Ahost=A0=
=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0 127.0.0.1/32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 md5=0A#host=A0=
=A0=A0 all=A0=A0=A0 =A0=A0=A0 all=A0=A0=A0 =A0=A0=A0 192.168.1.0/24=A0=A0=
=A0 =A0=A0=A0 md5=0A=0A=0Aand is the same i have on the raspberry.=0A

Re: psql security fail?

From
John R Pierce
Date:
On 11/3/2013 12:20 PM, Maxy wrote:
> psql -d mydb
>
> pg asks me the password but if i do
>
> psql -U postgresql -d mydb
>
> pg don't ask me the password.
> PostgreSQL 9.2.4 on i686-pc-linux-gnu, compiled by gcc (GCC) 4.7.1, 32-bit


$ psql -U postgresql -d mydb
psql: FATAL:  role "postgresql" does not exist

  PostgreSQL 9.2.4 on i686-pc-linux-gnu, compiled by gcc (GCC) 4.1.2
20080704 (Red Hat 4.1.2-54), 32-bit


something is whack.


--
john r pierce                                      37N 122W
somewhere on the middle of the left coast

Re: psql security fail?

From
Magnus Hagander
Date:
On Tue, Nov 5, 2013 at 9:10 PM, John R Pierce <pierce@hogranch.com> wrote:
> On 11/3/2013 12:20 PM, Maxy wrote:
>>
>> psql -d mydb
>>
>> pg asks me the password but if i do
>>
>> psql -U postgresql -d mydb
>>
>> pg don't ask me the password.
>> PostgreSQL 9.2.4 on i686-pc-linux-gnu, compiled by gcc (GCC) 4.7.1, 32-bit
>
>
>
> $ psql -U postgresql -d mydb
> psql: FATAL:  role "postgresql" does not exist
>
>  PostgreSQL 9.2.4 on i686-pc-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704
> (Red Hat 4.1.2-54), 32-bit
>
>
> something is whack.

I would check if there's by any chance a .pgpass file in your home
directory, which contains the password used to log in.


--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

Re: psql security fail?

From
Maxy
Date:
=0A=0A>something is whack.=0A=0Ait's postgres. but i did right in my pc.=0A

Re: psql security fail?

From
Maxy
Date:
=0A=0A>I would check if there's by any chance a .pgpass file in your home=
=0Adirectory, which contains the password used to log in.=0A=0Ait worked! i=
 don't know how it is appeared that file, but i will read the manual.=0A=0A=
thank you very much!!!!!!

Re: psql security fail?

From
Alvaro Herrera
Date:
Maxy wrote:

> >I would check if there's by any chance a .pgpass file in your home
> >directory, which contains the password used to log in.
>
> it worked! i don't know how it is appeared that file, but i will read the manual.

IIRC pgadmin creates it automatically?

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Re: psql security fail?

From
Maxy
Date:
>IIRC pgadmin creates it automatically?=0A=0A=0Ai think it is possible.=0A