pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem with connection to host (wrong host)
3+ messages / 3 participants
[nested] [flat]

* Problem with connection to host (wrong host)
@ 2018-03-31 15:44  Mike Martin <redtux1@gmail.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Mike Martin @ 2018-03-31 15:44 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hi
I am just setting up a postgres server, details
Host 192.168.0.3
pg_hba.conf
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             192.168.0.0/32            ident
# IPv6 local connections:
host    all             all             127.0.0.1/32            ident

host    all             all             ::1/128                 ident

postgresql.conf
listen_addresses-'*'

however when I try to connect from my laptop (ip 192.168.0.2) I get

psql -h 192.168.0.3 -U usevideo -W
Password for user usevideo:
psql: FATAL:  no pg_hba.conf entry for host "192.168.0.2", user "usevideo",
database "usevideo", SSL off

So a bit confused, is psql ignoring the host parameter

thanks

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

* Re: Problem with connection to host (wrong host)
@ 2018-03-31 15:59  Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  parent: Mike Martin <redtux1@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Peter Eisentraut @ 2018-03-31 15:59 UTC (permalink / raw)
  To: Mike Martin <redtux1@gmail.com>; pgsql-general@lists.postgresql.org

On 3/31/18 11:44, Mike Martin wrote:
> Hi
> I am just setting up a postgres server, details
> Host 192.168.0.3
> pg_hba.conf
> # TYPE  DATABASE        USER            ADDRESS                 METHOD
> 
> # "local" is for Unix domain socket connections only
> local   all             all                                     peer
> # IPv4 local connections:
> host    all             all             192.168.0.0/32
> <http://192.168.0.0/32>            ident

This entry should probably be something like

192.168.0.0/24

Writing .0/32 doesn't make much sense.

> # IPv6 local connections:
> host    all             all             127.0.0.1/32
> <http://127.0.0.1/32>            ident
> 
> host    all             all             ::1/128                 ident
> 
> postgresql.conf
> listen_addresses-'*'
> 
> however when I try to connect from my laptop (ip 192.168.0.2) I get
> 
> psql -h 192.168.0.3 -U usevideo -W
> Password for user usevideo:
> psql: FATAL:  no pg_hba.conf entry for host "192.168.0.2", user
> "usevideo", database "usevideo", SSL off
> 
> So a bit confused, is psql ignoring the host parameter

.3 is the host you are connecting to, as seen from the client.

.2 is the host your connection is coming from, as seen from the server.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




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

* Re: Problem with connection to host (wrong host)
@ 2018-03-31 16:00  Melvin Davidson <melvin6925@gmail.com>
  parent: Mike Martin <redtux1@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Melvin Davidson @ 2018-03-31 16:00 UTC (permalink / raw)
  To: Mike Martin <redtux1@gmail.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

On Sat, Mar 31, 2018 at 11:44 AM, Mike Martin <redtux1@gmail.com> wrote:

> Hi
> I am just setting up a postgres server, details
> Host 192.168.0.3
> pg_hba.conf
> # TYPE  DATABASE        USER            ADDRESS                 METHOD
>
> # "local" is for Unix domain socket connections only
> local   all             all                                     peer
> # IPv4 local connections:
> host    all             all             192.168.0.0/32            ident
> # IPv6 local connections:
> host    all             all             127.0.0.1/32            ident
>
> host    all             all             ::1/128                 ident
>
> postgresql.conf
> listen_addresses-'*'
>
> however when I try to connect from my laptop (ip 192.168.0.2) I get
>
> psql -h 192.168.0.3 -U usevideo -W
> Password for user usevideo:
> psql: FATAL:  no pg_hba.conf entry for host "192.168.0.2", user
> "usevideo", database "usevideo", SSL off
>
> So a bit confused, is psql ignoring the host parameter
>
> thanks
>
>
>




*>So a bit confused, is psql ignoring the host parameter It is not ignoring
your entry, you simply have not entry for the laptop you are connecting
from,So simply add the following:*
*host    all             all             192.168.0.2/32
ident     *           <- note, you may have to change the authentication
method depending on your environment



-- 
*Melvin Davidson*
*Maj. Database & Exploration Specialist*
*Universe Exploration Command – UXC*
Employment by invitation only!

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


end of thread, other threads:[~2018-03-31 16:00 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-03-31 15:44 Problem with connection to host (wrong host) Mike Martin <redtux1@gmail.com>
2018-03-31 15:59 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2018-03-31 16:00 ` Melvin Davidson <melvin6925@gmail.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