The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PostgreSQL Remote Connection

Discussion in 'General Discussion' started by maxihost2, Sep 25, 2005.

  1. maxihost2

    maxihost2 Well-Known Member
    PartnerNOC

    Joined:
    Feb 28, 2005
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    Im trying to make a remote connection using a Windows Program called "EMS PostgreSQL Manager".

    I am having issues setting up the pg_hba.conf properly to allow a user to make connections only to his assigned database.

    Following the PostgreSQL documentation I could sucessfuly connect using a user password with the following entry in pg_hba.conf:

    host all all my_ip 255.255.255.255 md5

    With the above line I could connect to the server using a user password, although I could see all the databases of the server and manage all of them.

    When I change it to:

    host database_that_user_should_connect all my_ip 255.255.255.255 md5

    I get an error message: no pga_hba.conf entry for host "my_ip", user "user", database "template1" (dont know why it says template1 if the database I choose was another one)

    I have also tried using:

    host all all my_ip 255.255.255.255 ident test

    With the proper lines inside pg_ident.conf for "test" *******:

    pg_ident.conf
    test user pg_user

    With no success

    Anyone can help me ? I would like to allow a pg user to connect only to his assigned database providing the correct password.

    Thank you very much.
     
  2. Secret Agent

    Secret Agent Guest

    I am interested in trying to connect as well but cannot.

    locate shows no pg_hba.conf file although postgresql is installed

    Here are the attempted Postgres connection settings:|
    address: xxx.133.65.178
    port: 5432
    db: upraise_main
    user: upraise_postgres
    pass: pass

    Please see error message from pgAdmin below:

    Access to database denied
    The server doesn't grant access to the database: the server reports
    FATAL: no pg_hba.conf entry for host "xxx.198.64.148", user "upraise_postgres", database "upraise_main", SSL off
    To access a database on a PostgreSQL server, you first have to grant primary access to the server for your client (Host Based Authentication). PostgreSQL will check the pg_hba.conf file if a pattern that matches your client address / username / database is present and enabled before any SQL GRANT access control lists are evaluated.
    The initial settings in pg_hba.conf are quite restrictive, in order to avoid unwanted security holes caused by unreviewed but mandatory system settings. You'll probably want to add something like
    host all all 192.168.0.0/24 md5
    This example grants MD5 encrypted password access to all databases to all users on the private network
    192.168.0.0/24.
    You can use the pg_hba.conf editor that is built into pgAdmin III to edit the pg_hba.conf configuration file. After changing pg_hba.conf, you need to trigger a server configuration reload using pg_ctl or by stopping and restarting the server process.
     
  3. Secret Agent

    Secret Agent Guest

    Anyone know about this? I'm a little confused just for the fact that the file is not there and I cannot reinstall pg without losing the current databases.
     
  4. Azraell

    Azraell Member

    Joined:
    Aug 2, 2006
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brasil / Rio de Janeiro
Loading...

Share This Page