What is a password for?

Поиск
Список
Период
Сортировка
Искать

What is a password for?

От:
Weiwei Guo <wwguocn@gmail.com>
Дата:
Dear all,

I am trying to create user/db under console with. I find that no matter I input a password or not when I'm creating or 
dropping a user/db, the action can be success. What is a password for?

The following is what I have done:

~ $ createuser -U postgres -W super_creater_ctreated
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) y
Password:
CREATE ROLE

~ $ createuser -U super_creater_ctreated -W test_creater_created
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n
Password: 
CREATE ROLE

~ $ dropuser -U super_creater_ctreated -W test_creater_created
Password:
DROP ROLE

~ $ createuser -U super_creater_ctreated -W test_creater_createdno
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n
Password:
CREATE ROLE

~ $ dropuser -U super_creater_ctreated -W test_creater_createdno
Password:
DROP ROLE



I cannot understand the mechanism for password. Is it a bug?

I'm using postgresql-8.2.6.


Weiwei

Re: What is a password for?

От:
Micah Yoder <micah@yoderdev.com>
Дата:
On Sunday 16 March 2008 12:31:40 am Weiwei Guo wrote:
> I cannot understand the mechanism for password. Is it a bug?

Check your pg_hba.conf file.  I suspect that for LOCAL connections you have 
specified TRUST "authentication".

If you want to enforce passwords you would change TRUST to MD5.

Re: What is a password for?

От:
"Andrej Ricnik-Bay" <andrej.groups@gmail.com>
Дата:
On 16/03/2008, Weiwei Guo  wrote:

>  I am trying to create user/db under console with. I find that no matter I input a password or not when I'm creating or
>  dropping a user/db, the action can be success. What is a password for?
That depends on which authentication mechanism(s)
you've defined in your pg_hba.conf



Cheers,
Andrej

-- 
Please don't top post, and don't use HTML e-Mail :}  Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm

Re: What is a password for?

От:
Weiwei Guo <wwguocn@gmail.com>
Дата:
Thank you, Micah and Andrej. I change TRUST to MD5 and password works 
mostly, but the user 'postgres' complains "
password authentication failed". Is there any special of 'postgres'?

Micah Yoder :
> On Sunday 16 March 2008 12:31:40 am Weiwei Guo wrote:
>> I cannot understand the mechanism for password. Is it a bug?
>
> Check your pg_hba.conf file.  I suspect that for LOCAL connections you have 
> specified TRUST "authentication".
>
> If you want to enforce passwords you would change TRUST to MD5.
>
>

Re: What is a password for?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Weiwei Guo  writes:
> Thank you, Micah and Andrej. I change TRUST to MD5 and password works 
> mostly, but the user 'postgres' complains "
> password authentication failed". Is there any special of 'postgres'?

Did you set a password for it?

			regards, tom lane

Re: What is a password for?

От:
Weiwei Guo <wwguocn@gmail.com>
Дата:
Yes, I set a password. I'm sure that I used the right password for 
'postgres'. I can su to 'postgres' with it.

~ $ createuser -U postgres -W test
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) y
Password: 
createuser: could not connect to database postgres: FATAL:  password 
authentication failed for user "postgres"



Tom Lane 写道:
> Weiwei Guo  writes:
>> Thank you, Micah and Andrej. I change TRUST to MD5 and password works 
>> mostly, but the user 'postgres' complains "
>> password authentication failed". Is there any special of 'postgres'?
>
> Did you set a password for it?
>
> 			regards, tom lane
>

Re: What is a password for?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Weiwei Guo  writes:
> Yes, I set a password. I'm sure that I used the right password for 
> 'postgres'. I can su to 'postgres' with it.

That would be your Unix password for the Unix account 'postgres'.
This has approximately zero to do with either the Postgres username
'postgres', or the Postgres password for that username.

			regards, tom lane

Re: What is a password for?

От:
Abdelkader Boudih <terminale@gmail.com>
Дата:
Use the *ALTER USER* to change the attributes and permissions of a 
*PostgreSQL* database *user*.

In psql do :

# **ALTER USER postgres WITH PASSWORD 'your_password';

Regards
**

Weiwei Guo wrote:
> Yes, I set a password. I'm sure that I used the right password for 
> 'postgres'. I can su to 'postgres' with it.
>
> ~ $ createuser -U postgres -W test
> Shall the new role be a superuser? (y/n) n
> Shall the new role be allowed to create databases? (y/n) n
> Shall the new role be allowed to create more new roles? (y/n) y
> Password: 
> createuser: could not connect to database postgres: FATAL:  password 
> authentication failed for user "postgres"
>
>
>
> Tom Lane 写道:
>> Weiwei Guo  writes:
>>> Thank you, Micah and Andrej. I change TRUST to MD5 and password 
>>> works mostly, but the user 'postgres' complains "
>>> password authentication failed". Is there any special of 'postgres'?
>>
>> Did you set a password for it?
>>
>>             regards, tom lane
>>
>

FAQ