psql security fail?

Started by Maxyover 12 years ago11 messagesbugs
Jump to latest
#1Maxy
maxy0440yxam@yahoo.it

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.
PostgreSQL 9.2.4 on i686-pc-linux-gnu, compiled by gcc (GCC) 4.7.1, 32-bit

i did some tries, and the same configuration and the same source
compiled on slackware arm 14.0 on a raspberry works without the bug.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Maxy (#1)
Re: psql security fail?

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

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#3Maxy
maxy0440yxam@yahoo.it
In reply to: Tom Lane (#2)
I: psql security fail?

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.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#4Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Maxy (#3)
Re: I: psql security fail?

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

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#5Maxy
maxy0440yxam@yahoo.it
In reply to: Alvaro Herrera (#4)
I: I: psql security fail?

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

pasted?

No, this is the pg_hba

local   all             all                                     md5
host    all             all             127.0.0.1/32            md5
#host    all        all        192.168.1.0/24        md5

and is the same i have on the raspberry.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#6John R Pierce
pierce@hogranch.com
In reply to: Maxy (#1)
Re: psql security fail?

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

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#7Magnus Hagander
magnus@hagander.net
In reply to: John R Pierce (#6)
Re: psql security fail?

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/

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#8Maxy
maxy0440yxam@yahoo.it
In reply to: John R Pierce (#6)
Re: psql security fail?

something is whack.

it's postgres. but i did right in my pc.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#9Maxy
maxy0440yxam@yahoo.it
In reply to: Magnus Hagander (#7)
Re: psql security fail?

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.

thank you very much!!!!!!

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#10Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Maxy (#9)
Re: psql security fail?

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

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#11Maxy
maxy0440yxam@yahoo.it
In reply to: Alvaro Herrera (#10)
Re: psql security fail?

IIRC pgadmin creates it automatically?

i think it is possible.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs