pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Client Authentication methods
3+ messages / 3 participants
[nested] [flat]

* Client Authentication methods
@ 2017-11-10 13:25  chiru r <chirupg@gmail.com>
  0 siblings, 2 replies; 3+ messages in thread

From: chiru r @ 2017-11-10 13:25 UTC (permalink / raw)
  To: pgsql-general

Hi All,

I am trying to understand the Authentication method in pg_hba.conf file
(password & md5) in PostgreSQL database server.

I am assuming that the user provides the  connection string
host/usser/password,then client will go and contact the DB server
pg_hba.conf file in memory without carrying password over the network
initially, and then it confirms the authentication method from pg_hba.conf
,then it decides weather it send clear text or md5 encrypted password from
client to Server to make a session?

Is my assumption is correct ? or What exactly it make the difference for
client if i use md5/password  in pg_hba.conf file in DB server?.

Thanks,
chiru

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

* Re: Client Authentication methods
@ 2017-11-10 13:56  Berend Tober <btober@computer.org>
  parent: chiru r <chirupg@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Berend Tober @ 2017-11-10 13:56 UTC (permalink / raw)
  To: chiru r <chirupg@gmail.com>; pgsql-general

chiru r wrote:
> Hi All,
>
> I am trying to understand the Authentication method in pg_hba.conf file (password & md5) in
> PostgreSQL database server.
>
> I am assuming that the user provides the  connection string host/usser/password,then client will go
> and contact the DB server pg_hba.conf file in memory without carrying password over the network
> initially, and then it confirms the authentication method from pg_hba.conf ,then it decides weather
> it send clear text or md5 encrypted password from client to Server to make a session?
>
> Is my assumption is correct ? or What exactly it make the difference for client if i use
> md5/password  in pg_hba.conf file in DB server?.
>


Your assumptions sound consistent with documentation appearing at


https://www.postgresql.org/docs/10/static/protocol-flow.html

https://www.postgresql.org/docs/10/static/auth-methods.html

-- B




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



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

* Re: Client Authentication methods
@ 2017-11-10 15:19  Peter J. Holzer <hjp-pgsql@hjp.at>
  parent: chiru r <chirupg@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Peter J. Holzer @ 2017-11-10 15:19 UTC (permalink / raw)
  To: pgsql-general

On 2017-11-10 08:25:24 -0500, chiru r wrote:
> I am trying to understand the Authentication method in pg_hba.conf file
> (password & md5) in PostgreSQL database server. 
> 
> I am assuming that the user provides the  connection string host/usser/
> password,then client will go and contact the DB server pg_hba.conf file in
> memory without carrying password over the network initially, and then it
> confirms the authentication method from pg_hba.conf ,then it decides weather it
> send clear text or md5 encrypted password from client to Server to make a
> session?

I'm not sure what "it" refers to in this sentence. If "it" refers to the
client (as grammatically it should) then the answer is no. The client
doesn't have access to the pg_hba.conf file.

The client connects to the server, sending the username and database
name, but not (yet) the password. Then the server checks the pg_hba.conf
file to determine which authentication method to use. The server then
sends an authentication request to the client, to which the client sends
a response (including, or based on, the password).


> Is my assumption is correct ? or What exactly it make the difference for client
> if i use md5/password  in pg_hba.conf file in DB server?.

See
https://www.postgresql.org/docs/10/static/auth-methods.html#AUTH-PASSWORD

With method password, passwords are sent in plain text. With md5, an md5
hash of the password, the username, and a nonce is sent instead.

        hp

-- 
   _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |   | hjp@hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/;

Attachments:

  signature.asc (application/pgp-signature, 832B) download

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


end of thread, other threads:[~2017-11-10 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-10 13:25 Client Authentication methods chiru r <chirupg@gmail.com>
2017-11-10 13:56 ` Berend Tober <btober@computer.org>
2017-11-10 15:19 ` Peter J. Holzer <hjp-pgsql@hjp.at>

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