pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
security question
5+ messages / 4 participants
[nested] [flat]

* security question
@ 2007-04-04 20:25  Dave Lazar <hunkybill@gmail.com>
  0 siblings, 3 replies; 5+ messages in thread

From: Dave Lazar @ 2007-04-04 20:25 UTC (permalink / raw)
  To: pgsql-admin

Hi,

I have a quick question about my installation that puzzles me. pgsql
8.2.3on a debian box. Tested it out the database works. pgadmin III
connects fine
too. I used alter table on the template1 database to give postgres user a
password. I changed pg_hba to use md5 on all connections including local.

When I use psql -U postgres -d myDataBase to connect to myDataBase I do not
get prompted for a password? When I su postgres and use psql myDatabase I
get prompted for my password?

Is there some reason why I can login using psql to a database when postgres
is supposed to use passwords for all access?

Probably a mistake I made somewhere along the line... just not sure where,
usually I get my pgsql install working great!

Thanks

Dave

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: security question
@ 2007-04-04 20:28  Ray Stell <stellr@cns.vt.edu>
  parent: Dave Lazar <hunkybill@gmail.com>
  2 siblings, 0 replies; 5+ messages in thread

From: Ray Stell @ 2007-04-04 20:28 UTC (permalink / raw)
  To: Dave Lazar <hunkybill@gmail.com>; +Cc: pgsql-admin

On Wed, Apr 04, 2007 at 04:25:17PM -0400, Dave Lazar wrote:
> password. I changed pg_hba to use md5 on all connections including local.

did you restart?



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: security question
@ 2007-04-04 20:29  Andy Shellam <andy.shellam-lists@mailnetwork.co.uk>
  parent: Dave Lazar <hunkybill@gmail.com>
  2 siblings, 0 replies; 5+ messages in thread

From: Andy Shellam @ 2007-04-04 20:29 UTC (permalink / raw)
  To: Dave Lazar <hunkybill@gmail.com>; +Cc: pgsql-admin

One quick point - you don't need to alter anything in the template1 
database to set user's passwords.
In PgAdmin III - use the "Login roles" section to set the passwords - 
that way everything will get committed correctly.

Also, have you restarted PostgreSQL since changing pg_hba.conf?

Andy.

Dave Lazar wrote:
> Hi,
>
> I have a quick question about my installation that puzzles me. pgsql 
> 8.2.3 on a debian box. Tested it out the database works. pgadmin III 
> connects fine too. I used alter table on the template1 database to 
> give postgres user a password. I changed pg_hba to use md5 on all 
> connections including local.
>
> When I use psql -U postgres -d myDataBase to connect to myDataBase I 
> do not get prompted for a password? When I su postgres and use psql 
> myDatabase I get prompted for my password?
>
> Is there some reason why I can login using psql to a database when 
> postgres is supposed to use passwords for all access?
>
> Probably a mistake I made somewhere along the line... just not sure 
> where, usually I get my pgsql install working great!
>
> Thanks
>
> Dave
> !DSPAM:37,46140a1b89297979110243! 




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: security question
@ 2007-04-04 20:35  Jeff Frost <jeff@frostconsultingllc.com>
  parent: Dave Lazar <hunkybill@gmail.com>
  2 siblings, 1 reply; 5+ messages in thread

From: Jeff Frost @ 2007-04-04 20:35 UTC (permalink / raw)
  To: Dave Lazar <hunkybill@gmail.com>; +Cc: pgsql-admin

On Wed, 4 Apr 2007, Dave Lazar wrote:

> I have a quick question about my installation that puzzles me. pgsql
> 8.2.3on a debian box. Tested it out the database works. pgadmin III
> connects fine
> too. I used alter table on the template1 database to give postgres user a
> password. I changed pg_hba to use md5 on all connections including local.
>
> When I use psql -U postgres -d myDataBase to connect to myDataBase I do not
> get prompted for a password? When I su postgres and use psql myDatabase I
> get prompted for my password?
>
> Is there some reason why I can login using psql to a database when postgres
> is supposed to use passwords for all access?
>
> Probably a mistake I made somewhere along the line... just not sure where,
> usually I get my pgsql install working great!

Most likely psql is picking up the password from ~/.pgpass when run as your 
user.  Pgadmin3 stores passwords in .pgpass, so it's likely been put in there 
by pgadmin.  As a test - move .pgpass to .pgpass.old and try to connect via 
psql -U postgres -d myDataBase again.

-- 
Jeff Frost, Owner 	<jeff@frostconsultingllc.com>
Frost Consulting, LLC 	http://www.frostconsultingllc.com/
Phone: 650-780-7908	FAX: 650-649-1954



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: security question
@ 2007-04-04 21:44  Jeff Frost <jeff@frostconsultingllc.com>
  parent: Jeff Frost <jeff@frostconsultingllc.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Jeff Frost @ 2007-04-04 21:44 UTC (permalink / raw)
  To: Dave Lazar <hunkybill@gmail.com>; +Cc: pgsql-admin

On Wed, 4 Apr 2007, Dave Lazar wrote:

>> Most likely psql is picking up the password from ~/.pgpass when run as
>> your
>> user.  Pgadmin3 stores passwords in .pgpass, so it's likely been put in
>> there
>> by pgadmin.  As a test - move .pgpass to .pgpass.old and try to connect
>> via
>> psql -U postgres -d myDataBase again.
>> 
>> 
> BINGO... thanks... first time I see .pgpass in action.. works like a
> charm... used to not work for me.. this is good :)

If it didn't work in the past, it was likely because of permissions problems. 
Pgadmin probably helpfully set the permissions properly for you when it 
created the file.

-- 
Jeff Frost, Owner 	<jeff@frostconsultingllc.com>
Frost Consulting, LLC 	http://www.frostconsultingllc.com/
Phone: 650-780-7908	FAX: 650-649-1954



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2007-04-04 21:44 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-04-04 20:25 security question Dave Lazar <hunkybill@gmail.com>
2007-04-04 20:28 ` Ray Stell <stellr@cns.vt.edu>
2007-04-04 20:29 ` Andy Shellam <andy.shellam-lists@mailnetwork.co.uk>
2007-04-04 20:35 ` Jeff Frost <jeff@frostconsultingllc.com>
2007-04-04 21:44   ` Jeff Frost <jeff@frostconsultingllc.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox