Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    7

    Unanswered: How to force the use of passwords

    Hello there,

    I have created 2 users for my postgres installation. One user with the rights to create db and users, and one user (for my php scripts), without the rights to create db and users.

    I have then modified the pg_hba.conf file as follow:
    local volyaweb xso crypt
    local volyaweb volyaweb crypt
    which, I would have hoped, would force me to use a password.

    I restarted postgres and created a PHP file without password to check the connection

    <?php
    $dbh = pg_connect("dbname=volyaweb user=volyaweb");
    if ($dbh) {
    print 'Connection OK';
    } else {
    print 'Connection failed';
    }
    ?>

    Although I do not specify any password, I'm still able to connect to the database via this PHP script. Is there any way to change this?

    Thanks in advance.

    xso

  2. #2
    Join Date
    Sep 2003
    Posts
    7
    My problem is solved. Sorry for the trouble.

  3. #3
    Join Date
    Apr 2003
    Location
    Tunisia
    Posts
    192

    Talking How

    We would like to know how ?
    Open up
    Take a look to my Blog http://www.rundom.com/karim2k

  4. #4
    Join Date
    Jan 2004
    Posts
    2
    in your pg_hba.conf change 'trust' to 'password'

  5. #5
    Join Date
    Sep 2003
    Posts
    7
    Hi Karim,

    Sorry, I just saw your post now. If I remember correctly, it was something completely stupid from my side: I had changed the config file for another Postgres server. Like I said, completely stupid. :-<

Posting Permissions

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