Обсуждение: Specific user does not require password for postgres

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

Specific user does not require password for postgres

От
"Serge Fonville"
Дата:
Hi,

I have installed PostgreSQL 8.3.4 on Windows Vista Business Edition.
My currently logged on user is the only user that does not need to specify a password when running psql -U postgres
I used the following guide:

PostgreSQL on Windows with SSL
----------------------------------
--All variables are in CAPITALS--
Create POSTGRES_SERVICE_USER
Remove POSTGRES_SERVICE_USER from Users
Assign POSTGRES_SERVICE_USER_PASSWORD to POSTGRES_SERVICE_USER
Grant POSTGRES_SERVICE_USER Run As Service (secpol.msc)
Create PGDIR (e.g. C:\Program Files\PostgreSQL)
Create PGDATA (e.g. C:\ProgramData\PostgreSQL\Data)
Define PGDATA
Define PGBIN (i.e. PGDIR\bin)
Add PGBIN to the Path
Give POSTGRES_SERVICE_USER change rights on both PGDATA as well as PGDIR
Extract PostgreSQL Windows archive to PGDIR
As an admin register PostgreSQL service
pg_ctl.exe register -U POSTGRES_SERVICE_USER -P POSTGRES_SERVICE_USER_PASSWORD -m smart
Start a shell as POSTGRES_SERVICE_USER
runas /user:POSTGRES_SERVICE_USER cmd.exe
Run initdb <-- PGDATA must exist and be writable
initdb.exe -A md5 -U POSTGRES_SUPER_USER -W
Create certificate
openssl req -new -text -out server.req -newkey rsa:8192
openssl rsa -in privkey.pem -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
Edit postgresql.conf
listen_addresses = 'localhost'
ssl = on
log_destination = 'stderr'
logging_collector = on
log_directory = 'pg_log'
log_filename = 'postgresql-%Y-%m-%d.log'
log_rotation_size = 5MB
client_min_messages = log
log_min_messages = info
log_min_error_statement = info
log_timezone = Europe/Amsterdam
Edit pg_hba.conf
hostssl all postgres ::1/128 md5
hostssl all postgres 127.0.0.1/32 md5

It seems odd to me that the user that is logged in (and created the services and directories) does not need to specify a password
I checked ownership on all directories (they are owned by local administrators) and the specific user is nowhere specified in the security permissions
Other users (also members of administrators) do need to specify a password.
Even though this is only a local development installation, I would really like to understand why this happens

Thanks in advance,

Serge Fonville

Re: Specific user does not require password for postgres

От
Raymond O'Donnell
Дата:
On 03/11/2008 16:21, Serge Fonville wrote:
> Hi,
>
> I have installed PostgreSQL 8.3.4 on Windows Vista Business Edition.
> My currently logged on user is the only user that does not need to
> specify a password when running psql -U postgres

What happens if you log in as a different user and then try to connect
as the original user using -U <username>?

Also, is there any chance that you've already connected using pgAdmin,
and saved the password? - this causes the password to be saved in a
.pgpass file, so you wouldn't be asked for it again when logged inas
that user.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------