Thread: probable pg_hba.conf configuration issues

probable pg_hba.conf configuration issues

From
Ravi Roy
Date:
Hi,
 
I'm sorry if this question have been asked earlier, but i could not find any valid result through googling.
 
I'm running postgresql 9.1 on Windows 7 (64 bit) and i've following configuration in pg_hba.conf.
 
host     all             superuser1    127.0.0.1/32     password
host     all             normaluser1  127.0.0.1/32     password
 
Using command line : psql -U superuser1 & psql -U normaluser1 asks for password and login successfully. - perfect. (We are only alloing local connections, remote connections to database are disabled)
 
But if I try to connect using pgadmin (from the same machine) it gives acess to database without password, i'm surprised as it does not seem to respect pg_hba.conf or i'm terribly wrong in the configuration somewhere.
 
Does somebody have any idea what is wrong?
 
Thank you
 
Ravi.
 
 
 
 

Re: probable pg_hba.conf configuration issues

From
Tom Lane
Date:
Ravi Roy <ravi.aroy@gmail.com> writes:
> Using command line : psql -U superuser1 & psql -U normaluser1 asks for
> password and login successfully. - perfect. (We are only alloing local
> connections, remote connections to database are disabled)

> But if I try to connect using pgadmin (from the same machine) it gives
> acess to database without password, i'm surprised as it does not seem to
> respect pg_hba.conf or i'm terribly wrong in the configuration somewhere.

pgadmin is no doubt caching the password somewhere.  I think it uses
~/.pgpass, though psql would too, so maybe there's something
pgadmin-specific involved.

            regards, tom lane


Re: probable pg_hba.conf configuration issues

From
Sim Zacks
Date:
<div class="moz-cite-prefix">My bet is you have either another line in the pg_hba that says trust<br /> or you saved
thepassword and forgot.<br /><br /> Sim<br /><br /> On 05/07/2014 05:33 PM, Ravi Roy wrote:<br /></div><blockquote
cite="mid:CAFMBnF_UHtTyucMxquDE0Sd5siy3NHERGiRKC3YkGT8xs1=e_Q@mail.gmail.com"type="cite"><div
dir="ltr"><div>Hi,</div><div> </div><div>I'msorry if this question have been asked earlier, but i could not find any
validresult through googling.</div><div> </div><div>I'm running postgresql 9.1 on Windows 7 (64 bit) and i've following
configurationin pg_hba.conf.</div><div> </div><div>host     all             superuser1    <a href="http://127.0.0.1/32"
moz-do-not-send="true">127.0.0.1/32</a>    password<br /> host     all             normaluser1  <a
href="http://127.0.0.1/32"moz-do-not-send="true">127.0.0.1/32</a>     password</div><div> </div><div>Using command line
:psql -U superuser1 & psql -U normaluser1 asks for password and login successfully. - perfect. (We are only
alloing localconnections, remote connections to database are disabled)</div><div> </div><div>But if I try to connect
usingpgadmin (from the same machine) it gives acess to database without password, i'm surprised as it does not seem to
respectpg_hba.conf or i'm terribly wrong in the configuration somewhere. </div><div> </div><div>Does somebody have any
ideawhat is wrong? </div><div> </div><div>Thank
you</div><div> </div><div>Ravi.</div><div> </div><div> </div><div> </div><div> </div></div></blockquote><br/> 

Re: probable pg_hba.conf configuration issues

From
David G Johnston
Date:
Ravi Roy wrote
> But if I try to connect using pgadmin (from the same machine) it gives
> acess to database without password, i'm surprised as it does not seem to
> respect pg_hba.conf or i'm terribly wrong in the configuration somewhere.

You likely told pgadmin to remember (store) passwords.

"If you select “Store password”, pgAdmin stores passwords you enter in the
~/.pgpass file under Unix or :file:%APPDATA%postgresqlpgpass.conf under
Win32 for later reuse. For details, see pgpass documentation. It will be
used for all libpq based tools. If you want the password removed, you can
select the server’s properties and uncheck the selection any time."

http://www.pgadmin.org/docs/1.18/connect.html



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/probable-pg-hba-conf-configuration-issues-tp5802949p5802954.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: probable pg_hba.conf configuration issues

From
Ravi Roy
Date:
Thanks Sim, Tom & David, i'm really amazed with quick answers and insight provided by you all.
I found and was a password cache issue under %APPDATA%\postgresql\pgpass.conf; I removed it and everything works as expected.
 
Thank you again guys!
Regards,
Ravi.


On Wed, May 7, 2014 at 8:22 PM, David G Johnston <david.g.johnston@gmail.com> wrote:
Ravi Roy wrote
> But if I try to connect using pgadmin (from the same machine) it gives
> acess to database without password, i'm surprised as it does not seem to
> respect pg_hba.conf or i'm terribly wrong in the configuration somewhere.

You likely told pgadmin to remember (store) passwords.

"If you select “Store password”, pgAdmin stores passwords you enter in the
~/.pgpass file under Unix or :file:%APPDATA%postgresqlpgpass.conf under
Win32 for later reuse. For details, see pgpass documentation. It will be
used for all libpq based tools. If you want the password removed, you can
select the server’s properties and uncheck the selection any time."

http://www.pgadmin.org/docs/1.18/connect.html



--
View this message in context: http://postgresql.1045698.n5.nabble.com/probable-pg-hba-conf-configuration-issues-tp5802949p5802954.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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