Re: Password as a command line argument to createuser

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jane Ren" <j2ren(at)ucsd(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Password as a command line argument to createuser
Date: 2007-12-19 06:23:20
Message-ID: 11107.1198045400@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Jane Ren" <j2ren(at)ucsd(dot)edu> writes:
> Is there a way I can specify the password as a command line argument to
> createuser?

No, and it would be a really bad idea if you could, as the password
would be exposed to everyone else on the machine (via "ps") while
createuser runs.

There are various ways to do this securely, but putting the password
on a program's command line isn't one of them. I'd suggest looking
at how psql's \password command does it.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2007-12-19 06:28:16 Re: Password as a command line argument to createuser
Previous Message Joshua D. Drake 2007-12-19 06:21:09 Re: Password as a command line argument to createuser