Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2013
    Posts
    1

    Unanswered: Connection Issue - Server Doesn't Listen

    Hello,
    I am trying to set up a data server for personal use using Ubuntu Server and Postgresql 9.1. I am new to both Linux and Postgresql so I will describe everything I did.

    So I installed Ubuntu server with SSH and Postgresql 9.1. I configured the /etc/network/interfaces to give my server a static IP and tested it using the SSH login.

    I didn't do anything to the Postgresql program except change the porstgresql.conf file so listen_addresses = '*'

    and the pg_hba.conf file by adding the lines
    host all all 0.0.0.0/0 md5
    host all all 192.168.1.103 (my laptops IP) 255.255.255 md5

    I am trying to connect remotely from my laptop using pgadmin3.

    I don't know what is wrong but I have been on this for a couple of days now and I don't know what to do. Any help would be appreciated.

    Thanks

  2. #2
    Join Date
    Oct 2010
    Location
    Orlando, FL
    Posts
    311
    Provided Answers: 1
    1st welcome and congrats on picking PostgreSQL. I think your only issue is you're missing CIDR representation in your 'pg_hba.conf'.

    Can you 1st establish a local connection from the server (localhost / 127.0.0.1)?

    In your $PGDATA/pg_hba.conf, you should have an entry as follows:

    Code:
    # TYPE  DATABASE        USER            ADDRESS                 METHOD
    
    # "local" is for Unix domain socket connections only
    local   all             all                                     md5
    local   postgres        postgres                                ident
    # IPv4 local connections:
    host    all             all             127.0.0.1/32            md5
    host    all             all             192.168.1.0/24          md5
    As you can see I have a local rule that allows my Linux OS 'postgres' user to map into the database 'postgres' user w/o a password. You can change this to md5 if you want but I prefer it as-is. Make sure you 1st set the password on the 'postgres' OS user before you try and connect or else the mapping will be disabled by Linux.

    Code:
    passwd postgres
    Assuming you can do this w/o any issue, I would then add a subnet block access list as I did versus individual IP's w/ a 30 CIDR. The last entry in my 'pg_hba.conf' shows anyone can connect to any database as long as they're in that particular IP block. Hope that helps! Everything else looks fine assuming you don't have SSL enabled in your postgresql.conf file.
    Last edited by CacheDrive; 11-19-13 at 15:57.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •