Re: postgresql configuration and set-up

BillMoseley_at_hank.org
Date: 03/17/04

  • Next message: Paul Johnson: "Re: First Time Install Problems"
    Date: Tue, 16 Mar 2004 23:05:03 -0800
    To: Tom Allison <tallison@tacocat.net>
    
    

    On Tue, Mar 16, 2004 at 09:30:27PM -0500, Tom Allison wrote:
    > I'm trying to get debian's postgresql server running on a machine.

    > But I'm stuck on what the passwords are for the users I create.

    > createdb foo
    > createuser foouser

    > works just fine.
    > But how do I log in to the database foo as user foouser?

    Something I'm learning about, too.

    A couple of different ways. One is to su to foouser and run
    psql, the other is to use psql -U foouser.

    > It says I need a password in the docs, But I have no clue what it might
    > be, I was never asked for one.

    You have to tell createuser that you want to supply a
    password (-P).

    As glenn posted, it seems like you need to setup the
    /etc/postresql/pg_hba.conf file.

    The pg_hba.conf file is only for authentication. It's used
    for proving that you are who you say you are. When you
    connect from an account you can use "ident" method and not
    worry about username and passwords. If you just run psql it
    knows your username. If you connect with sockets (using -h,
    for example) then you would need to have a local ident
    program available (like ident2) that would authenticate that
    you are indeed the user you say you are.

    In the pg_hba.conf file postgres looks for the first
    matching line by looking at the type (local or host), what
    database you want to connect to, and as what user. And
    maybe from what IP address or range.

    Then the final column says how to authenticate. Ident I
    mentioned above. I use md5 for password authentication.

    So, I'd create a user with

      createuser -P someuser

    and it would prompt for a password. And then use "md5" in
    the pg_hba.conf file to say to authenticate me by a
    requiring a password.

    Now, that authenticates to use the database. But, the issue
    I've been wondering about is this:

    I create tables as one user then I want another user to use
    those tables (like the web server). Then I need to GRANT
    access to every object in the database to that other user.

    I wonder if there's an easier way than having to GRANT every
    object -- like a global grant.

    --
    Bill Moseley
    moseley@hank.org
    -- 
    To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Paul Johnson: "Re: First Time Install Problems"

    Relevant Pages

    • Re: Application to Application authentication models....
      ... >you should be comfortable if that application's back-end or database ID's ... The very fact that the security credentials have to ... I accept that this may be the case for web applications per machines. ... authenticate against a directory service, ...
      (SecProg)
    • Re: Authentication
      ... how are you accessing the database? ... then you probably should be using a windows ... single sign on system) to authenticate your user. ... methods/properties with the PrincipalPermission attribute. ...
      (microsoft.public.dotnet.languages.csharp)
    • ASP.Net not impersonating for WSE 2.0
      ... I have several web services that use WSE to authenticate calling users. ... I use a UsernameToken that validates the sent username and password ... against our SqlServer database. ...
      (microsoft.public.dotnet.framework.aspnet.webservices)
    • ASP.Net not impersonating for WSE 2.0 AuthenticateToken method
      ... I have several web services that use WSE to authenticate calling users. ... I use a UsernameToken that validates the sent username and password ... against our SqlServer database. ...
      (microsoft.public.dotnet.framework.aspnet.webservices)