Thread: set passwd for users

set passwd for users

From
"Johnson, Shaunn"
Date:

Howdy: 

Running PostgreSQL 7.2.1 on RedHat Linux 7.2.

Is it possible to have a password set for users for
command line use?

For example, I have scripts where I create and maintain
some aspects of the database.  Let's say that a user
doesn't like the permission that I set for the table and wants
to change it themselves.  They could do something like this:

testdb> \c database newuser

and are now the new user 'newuser'.  How can I set
this up to work via the command line as well as with
some ODBC connection?

I am looking in the pg_hba.conf file and I see where
it talks about the system, permissions and such,
but I am more curious as to how to set my file
up so that maybe only the postgreSQL user can have
root-like accesses.

Thanks!

-X

Re: set passwd for users

From
"scott.marlowe"
Date:
On Mon, 28 Apr 2003, Johnson, Shaunn wrote:

>
> Howdy:
>
> Running PostgreSQL 7.2.1 on RedHat Linux 7.2.
>
> Is it possible to have a password set for users for
> command line use?
>
> For example, I have scripts where I create and maintain
> some aspects of the database.  Let's say that a user
> doesn't like the permission that I set for the table and wants
> to change it themselves.  They could do something like this:
>
>
> testdb> \c database newuser
>
> and are now the new user 'newuser'.  How can I set
> this up to work via the command line as well as with
> some ODBC connection?
>
> I am looking in the pg_hba.conf file and I see where
> it talks about the system, permissions and such,
> but I am more curious as to how to set my file
> up so that maybe only the postgreSQL user can have
> root-like accesses.

Yes, you can do this.  The file that controls this behavior is the one
located in $PGDATA called pg_hba.conf.  It, by default, is set to let
local unix socket connections occur with "trust" which means that if you
say you're Kim Jong Il, you must be.

If you change that setting to something else, then you'll have to always
procide your password when connecting.

I think you have to do a complete shutdown/startup cycle on postgresql for
this to take effect.