Results 1 to 11 of 11

Thread: auth problem

  1. #1
    Join Date
    Apr 2003
    Posts
    1

    Unhappy Unanswered: auth problem

    Hi,

    I'm using postgres 7.1.3 as packaged with Suse Linux 7.3.
    I ran into trouble trying to password protect postgres access.

    The systems works fine I can create/drop databases, tables, data, users etc.

    I only need access from localhost to the database (web backend), but I don't want any user to have free run of the database server.

    I created a new user test

    CREATE USER test WITH PASSWORD 'test';

    login still didn't require a password.
    In /usr/share/pgsql/pg_hba.conf I switched

    local all trust
    host all 127.0.0.1 255.255.255.255 trust

    to

    local all password
    host all 127.0.0.1 255.255.255.255 password


    (I also tried 'crypt' instead of 'trust' and 'password'.)

    Now I get

    # psql -U test testdb
    psql: connectDBStart() -- connect() failed: Connection refused
    Is the postmaster running locally
    and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'?

    The socket did't exist, so created the file (but I guess the communication was using the tcp port anyway)

    I read the manual section, but I didn't find it very enlighting. The manual also states, that pg_hba.conf can be editted on the fly because it will be read at any conntection attempt. This doesn't seem to be true in this case. Changing and not restating the server, doesn't change anthing, restarting the server will block any attempt at connection.


    I guess I'm lacking something very fundamental? Any suggestions?

    thanks!

  2. #2
    Join Date
    Dec 2002
    Posts
    15
    I prefer to edit the pg_hba.conf file and send postmaster a SIGHUP signal.

    You shouldn't need to create a socket file if postmaster is running and accepting tcp connections.

    techdocs has a detailed install guide, maybe that will help.

  3. #3
    Join Date
    Aug 2003
    Posts
    17
    Could you tell me how to send this SIGHUP signal? I was Googling for it but couldn't find exactly how to do it, and I don't want to accidentally take down the server... thanks very much!

  4. #4
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    signal

    pg_ctl [YOUR OPTIONS] reload
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  5. #5
    Join Date
    Aug 2003
    Posts
    17
    pg_ctl and do 'status' I get:

    Code:
    pg_ctl: postmaster is running (pid: 30967)
    Command line was:
    /usr/local/pgsql/bin/postmaster '-i'
    If that's the case, can I run pg_ctl with 'reload' like this

    Code:
    pg_ctl -i reload
    and not have problems? Or are there more options I should be passing? I have entries in my start script like this:

    Code:
    start)
            $ECHO_N "Starting PostgreSQL: "$ECHO_C
            su - $PGUSER -c "$DAEMON start -D '$PGDATA' -s -l $PGLOG -o '-i'" 
            echo "ok"
            ;;
    If you could answer those questions I'd really appreciate it - just don't want to take down my server!

  6. #6
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    system

    Is this a production system???

    Are you the administrator?


    su - $PGUSER -c "$DAEMON start -D '$PGDATA' -s -l $PGLOG -o '-i'"


    If you don't know the values of the datadir $PGDATA the logfile $PGLOG
    the user $PGUSER and the executable $DAEMON you are lost

    How do you start the postmaster?

    if you call the startup script there should be also a mehtod to reload

    Look at it I can't find out your system values
    YOU MUST KNOW THIS
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  7. #7
    Join Date
    Aug 2003
    Posts
    17
    I know all the values of those variables, I was just asking which ones need to be passed to pg_ctl. I wasn't sure it if was that entire string or only the options part of it, ie:

    Code:
    -o '-i'
    Thanks. Hopefully I'm not quite as ignorant as I came off in the last post.

  8. #8
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    hope so

    I hope so otherwise you will have problems dealing with postgres
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  9. #9
    Join Date
    Aug 2003
    Posts
    17
    So, just to make sure I understand you, when running a reload on postgres, you need to pass it all the arguments as if you were doing a start or restart? I wasn't sure if the "reload" took a smaller set of arguments. Thanks a lot for your help.

  10. #10
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    reload

    with the reload option you only must enter -D
    the data source then the postmaster will read the config files and thats it
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  11. #11
    Join Date
    Aug 2003
    Posts
    17
    Thanks! I actually managed to figure that out myself but forgot to post here letting you know. I appreciate your help.

Posting Permissions

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