From: | bwnabble <bwiese(at)cotse(dot)com> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org |
Subject: | after initdb - Re: How to CREATEDB in commandline with no prompt for password |
Date: | 2008-03-04 00:50:58 |
Message-ID: | 15817886.post@talk.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin pgsql-es-ayuda |
Rajiv Rajaian-2 wrote:
>
> [root(at)g151 ~]# su postgres -c "createdb postgres"
> could not change directory to "/root"
> CREATE DATABASE
> [root(at)g151 ~]# echo "CREATE USER globus WITH PASSWORD 'globus' CREATEDB;"
> |
> psql -U postgres -d postgres
> psql: FATAL: Ident authentication failed for user "postgres"
> [root(at)g151 ~]# su postgres -c "echo \"CREATE USER globus WITH PASSWORD
> 'globus' CREATEDB;\" | psql -U postgres -d postgres"
> could not change directory to "/root"
> CREATE USER
> [root(at)g151 ~]# su globus -c "createdb rftDatabase"
> could not change directory to "/root"
> CREATE DATABASE
>
Rajiv,
Did you have your METHODs set to "trust" in your "pg_hba.conf" file (in the
$PGDATA directory)?
My question is, similar to yours, is there a way to:
1) run "initdb" as user "postgres" on an empty $PGDATA directory to start
from scratch
2) change the METHODs in "$PGDATA/pg_hba.conf" from "trust" -> "password"
3) start the postgresql server
4) run "createdb mydb" with no prompt for a password? (as user root or
postgres?)
I can only perform step 4 (createdb mydb) when the default METHOD is "trust"
in pg_hba.conf and I'm wondering if is any way around it? I want to disable
"trust" for security purposes.
Must I use the METHOD "trust" first in order to create a user with
"createdb" privileges, and then change METHODs in pg_hba.conf from "trust"
to "password"?
--
View this message in context: http://www.nabble.com/How-to-create-a-new-user-with-password-in-commandline-with-no-prompt-for-password-tp15583904p15817886.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
From | Date | Subject | |
---|---|---|---|
Next Message | bwnabble | 2008-03-04 02:28:05 | after initdb - Re: How to CREATEDB in commandline with no prompt for password |
Previous Message | Ryan Wells | 2008-03-03 20:22:36 | Error restoring after 8.3 upgrade |
From | Date | Subject | |
---|---|---|---|
Next Message | Jaime Casanova | 2008-03-04 01:11:01 | Re: Postgresql 8.4 caracteristicas |
Previous Message | alfredo guzman | 2008-03-04 00:42:14 | Dudas Sobre Postgresql en OLAP |