Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 02:22 AM
Ying Lu
Guest
 
Posts: n/a
Default about "pg_dump " without pompt password

Hello all,

Is it possible that we setup the password in the pg_dump command line
instead of let users input it through prompt command. E.g.,

pg_dump test -c -d --host=localhost -U testUser1 --file='a.dmp'
--no-privileges

Thanks a lot!
Ly


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

  #2  
Old November 23rd, 2005, 02:22 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: about "pg_dump " without pompt password

Ying Lu <ying_lu@cs.concordia.ca> writes:[color=blue]
> Is it possible that we setup the password in the pg_dump command line[/color]

You might as well put it on a billboard --- anything in the command line
can be seen by anyone who runs "ps".

If you don't want to supply it manually, put it in ~/.pgpass.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

  #3  
Old November 23rd, 2005, 02:23 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: about "pg_dump " without pompt password

David Garamond <lists@zara.6.isreserved.com> writes:[color=blue]
> Tom Lane wrote:[color=green][color=darkred]
>>> Is it possible that we setup the password in the pg_dump command line[/color]
>>
>> You might as well put it on a billboard --- anything in the command line
>> can be seen by anyone who runs "ps".
>>
>> If you don't want to supply it manually, put it in ~/.pgpass.[/color][/color]
[color=blue]
> At least in Linux, mysql replaces the password in the command line
> argument with "xxxxxxxx" so you can't see them via "ps" nor via peeking
> into /proc/<PID>/cmdline.[/color]
[color=blue]
> There is a short period where the password is visible though.[/color]
[color=blue]
> Are there any other risks? Or is the reason for not doing this is
> because not all OS'es supports replacing the command line information?[/color]

You just enumerated two fatal strikes against it; do you need more?
If so, consider the question of where the password on the command line
is going to come from. Allowing that would encourage people to put
passwords into possibly-insecurely-stored scripts. Or, depending on how
complicated the shell script is, there might be ancestor shell processes
that also have the password visible in their arguments ... and they
are certainly not going to know to xxx it out.

The ~/.pgpass technique is secure on every Unix, and we can *check* that
it's secure, by refusing to use .pgpass if it's got group or world
access allowed.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

  #4  
Old November 23rd, 2005, 02:23 AM
David Garamond
Guest
 
Posts: n/a
Default Re: about "pg_dump " without pompt password

Tom Lane wrote:[color=blue][color=green]
>>Is it possible that we setup the password in the pg_dump command line[/color]
>
> You might as well put it on a billboard --- anything in the command line
> can be seen by anyone who runs "ps".
>
> If you don't want to supply it manually, put it in ~/.pgpass.[/color]

At least in Linux, mysql replaces the password in the command line
argument with "xxxxxxxx" so you can't see them via "ps" nor via peeking
into /proc/<PID>/cmdline.

There is a short period where the password is visible though.

Are there any other risks? Or is the reason for not doing this is
because not all OS'es supports replacing the command line information?

--
dave

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

  #5  
Old November 23rd, 2005, 02:23 AM
David Garamond
Guest
 
Posts: n/a
Default Re: about "pg_dump " without pompt password

Tom Lane wrote:[color=blue][color=green]
>>At least in Linux, mysql replaces the password in the command line
>>argument with "xxxxxxxx" so you can't see them via "ps" nor via peeking
>>into /proc/<PID>/cmdline.[/color]
>[color=green]
>>There is a short period where the password is visible though.[/color]
>[color=green]
>>Are there any other risks? Or is the reason for not doing this is
>>because not all OS'es supports replacing the command line information?[/color]
>
> You just enumerated two fatal strikes against it; do you need more?
> If so, consider the question of where the password on the command line
> is going to come from. Allowing that would encourage people to put
> passwords into possibly-insecurely-stored scripts. Or, depending on how
> complicated the shell script is, there might be ancestor shell processes
> that also have the password visible in their arguments ... and they
> are certainly not going to know to xxx it out.[/color]

Yeah, I have some Perl/Ruby scripts that does "wget --proxy-user ...
--proxy-passwd ..." that reports the output through crontab and I have
to do the XXX-ing manually to prevent everyone that receives the cron
output to read the username/password. Should've stored the password in
~/.wgetrc too, I guess.
[color=blue]
> The ~/.pgpass technique is secure on every Unix, and we can *check* that
> it's secure, by refusing to use .pgpass if it's got group or world
> access allowed.[/color]

I love the Postgres community. It's all about doing things _properly_. :-)

--
dave

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles