From klodoma@ar-sd.net Tue Feb 8 08:11:31 2005 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 101AF8B9E6C for ; Tue, 8 Feb 2005 08:11:31 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81644-03 for ; Tue, 8 Feb 2005 08:11:22 +0000 (GMT) Received: from ar-sd.net (unknown [82.77.155.72]) by svr1.postgresql.org (Postfix) with ESMTP id DA0328B9E04 for ; Tue, 8 Feb 2005 08:11:22 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by ar-sd.net (Postfix) with ESMTP id 7B8231EC7D for ; Tue, 8 Feb 2005 10:05:17 +0200 (EET) Received: from ar-sd.net ([127.0.0.1]) by localhost (linz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 13788-02 for ; Tue, 8 Feb 2005 10:05:16 +0200 (EET) Received: from forge (unknown [192.168.0.11]) by ar-sd.net (Postfix) with SMTP id 430821EBF0 for ; Tue, 8 Feb 2005 10:05:16 +0200 (EET) Message-ID: <007501c50db5$c6e204f0$0b00a8c0@forge> From: "Andrei Bintintan" To: Subject: Win32 Postgresql Command Line Password Specification Date: Tue, 8 Feb 2005 10:11:20 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0072_01C50DC6.892DC110" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at ar-sd.net X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.059 tagged_above=0 required=5 tests=AWL, HTML_50_60, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200502/60 X-Sequence-Number: 16228 This is a multi-part message in MIME format. ------=_NextPart_000_0072_01C50DC6.892DC110 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi,=20 I have to run some command line commands that I have to run on a windows = machine. Like pgsql, dropdb, createdb etc.=20 All these commands are runned from a php scripts.=20 Now, my question is how can I specify a User and Password to postgresql = database system. I found out how can I say the user, but the password is = always asked in the command line. I need this also to be specified in = the command.=20 for example: dropdb database1 -U postgres -W.... always ask a password = in the command line.=20 I want to specify in the command line the pass. The only solution that I found for this problem is to put the postgre = user autentication to trust and to skip the password.=20 Andy. ------=_NextPart_000_0072_01C50DC6.892DC110 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I have to run some command line = commands that I=20 have to run on a windows machine. Like pgsql, dropdb, createdb etc.=20
All these commands are runned from a = php scripts.=20
 
Now, my question is how can I specify a = User and=20 Password to postgresql database system. I found out how can I say the = user, but=20 the password is always asked in the command line. I need this also to be = specified in the command.
 
for example: dropdb database1 -U = postgres -W....=20 always ask a password in the command line.
I want to specify in the command line = the=20 pass.
 
The only solution that I found for this = problem is=20 to put the postgre user autentication to trust and to skip the password. =
 
Andy.
------=_NextPart_000_0072_01C50DC6.892DC110-- From iain@mst.co.jp Tue Feb 8 08:35:53 2005 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3EF438B9E04 for ; Tue, 8 Feb 2005 08:35:53 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 86837-02 for ; Tue, 8 Feb 2005 08:35:43 +0000 (GMT) Received: from millenium.mst.co.jp (millenium.mst.co.jp [210.251.240.193]) by svr1.postgresql.org (Postfix) with ESMTP id C6EF38B9B86 for ; Tue, 8 Feb 2005 08:35:40 +0000 (GMT) Received: from mst1x5r347kymb (lc12114 [192.168.1.114]) by millenium.mst.co.jp (8.11.6p2/3.7W) with SMTP id j188YhQ23766; Tue, 8 Feb 2005 17:34:43 +0900 Message-ID: <000d01c50db9$7e7b0730$7201a8c0@mst1x5r347kymb> From: "Iain" To: "Andrei Bintintan" , References: <007501c50db5$c6e204f0$0b00a8c0@forge> Subject: Re: Win32 Postgresql Command Line Password Specification Date: Tue, 8 Feb 2005 17:37:54 +0900 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0009_01C50E04.EB5E21C0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.056 tagged_above=0 required=5 tests=AWL, HTML_50_60, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200502/61 X-Sequence-Number: 16229 This is a multi-part message in MIME format. ------=_NextPart_000_0009_01C50E04.EB5E21C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I think that's the best way to do it. Rather than leave passwords lying around in script files, it might be best to trust a specific (specially created) user when running from a specific location on the specific database. Then you just have to keep that user account secure. I can imagine how it would work wth linux, but am not sure what problems youmay face under windows. The only other alternative I can imagine is to use another program to type the password in automatically. I've never done it but I'm sure such a beast must exist. The long and the short of it is (at least upto 7.4.6 - I don't know about later versions) thereis no way to specify the password on the commandline. Regards Iain ----- Original Message ----- From: Andrei Bintintan To: pgsql-admin@postgresql.org Sent: Tuesday, February 08, 2005 5:11 PM Subject: [ADMIN] Win32 Postgresql Command Line Password Specification Hi, I have to run some command line commands that I have to run on a windows machine. Like pgsql, dropdb, createdb etc. All these commands are runned from a php scripts. Now, my question is how can I specify a User and Password to postgresql database system. I found out how can I say the user, but the password is always asked in the command line. I need this also to be specified in the command. for example: dropdb database1 -U postgres -W.... always ask a password in the command line. I want to specify in the command line the pass. The only solution that I found for this problem is to put the postgre user autentication to trust and to skip the password. Andy. ------=_NextPart_000_0009_01C50E04.EB5E21C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I think that's the best way to = do=20 it.
 
Rather than leave passwords = lying around=20 in script files, it might be best to trust a specific (specially = created) user=20 when running from a specific location on the specific database. Then you = just=20 have to keep that user account secure. I can imagine how it would work = wth=20 linux, but am not sure what problems youmay face under = windows.
 
The only other alternative I = can imagine=20 is to use another program to type the password in automatically. I've = never done=20 it but I'm sure such a beast must exist.
 
The long and the short of it = is (at least=20 upto 7.4.6 - I don't know about later versions) thereis no way to = specify the=20 password on the commandline.
 
Regards
Iain
----- Original Message -----
From:=20 Andrei=20 Bintintan
To: pgsql-admin@postgresql.org=
Sent: Tuesday, February = 08, 2005=20 5:11 PM
Subject: [ADMIN] Win32 = Postgresql=20 Command Line Password Specification

Hi,
 
I have to run some command line = commands that I=20 have to run on a windows machine. Like pgsql, dropdb, createdb etc.=20
All these commands are runned from a = php scripts.=20
 
Now, my question is how can I specify = a User and=20 Password to postgresql database system. I found out how can I say the = user,=20 but the password is always asked in the command line. I need this also = to be=20 specified in the command.
 
for example: dropdb database1 -U = postgres -W....=20 always ask a password in the command line.
I want to specify in the command line = the=20 pass.
 
The only solution that I found for = this problem=20 is to put the postgre user autentication to trust and to skip the = password.=20
 
Andy.
------=_NextPart_000_0009_01C50E04.EB5E21C0-- From tom@jobflash.com Tue Feb 8 09:02:34 2005 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 20CE08B9CE7 for ; Tue, 8 Feb 2005 09:02:34 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 89869-07 for ; Tue, 8 Feb 2005 09:02:24 +0000 (GMT) Received: from mail.jobflash.com (oncallweb2.jobflash.com [64.62.211.41]) by svr1.postgresql.org (Postfix) with ESMTP id 0F1DC8B9B2E for ; Tue, 8 Feb 2005 09:02:25 +0000 (GMT) Received: from [192.168.2.22] (user-38lc014.dialup.mindspring.com [209.86.0.36]) by mail.jobflash.com (Postfix) with ESMTP id 6AEE5420CF; Tue, 8 Feb 2005 01:02:21 -0800 (PST) Message-ID: <42088001.3010602@jobflash.com> Date: Tue, 08 Feb 2005 01:01:53 -0800 From: Tom Arthurs User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrei Bintintan Cc: pgsql-admin@postgresql.org Subject: Re: Win32 Postgresql Command Line Password Specification References: <007501c50db5$c6e204f0$0b00a8c0@forge> In-Reply-To: <007501c50db5$c6e204f0$0b00a8c0@forge> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/62 X-Sequence-Number: 16230 Not sure if it will work in windows, but in unix, I use the envrionmental variable PGPASSWORD Not the safest thing in the world, but in my case, if a hacker's gotten through two layers of firewall, I'm sunk anyhow. :) Andrei Bintintan wrote: > Hi, > > I have to run some command line commands that I have to run on a windows > machine. Like pgsql, dropdb, createdb etc. > All these commands are runned from a php scripts. > > Now, my question is how can I specify a User and Password to postgresql > database system. I found out how can I say the user, but the password is > always asked in the command line. I need this also to be specified in > the command. > > for example: dropdb database1 -U postgres -W.... always ask a password > in the command line. > I want to specify in the command line the pass. > > The only solution that I found for this problem is to put the postgre > user autentication to trust and to skip the password. > > Andy. From desoi@pgedit.com Tue Feb 8 13:39:12 2005 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B5F248B9EDC for ; Tue, 8 Feb 2005 13:39:12 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 14638-07 for ; Tue, 8 Feb 2005 13:38:58 +0000 (GMT) Received: from a2s1.a2webhosting.com (host-180.a2webhosting.com [69.39.89.180]) by svr1.postgresql.org (Postfix) with ESMTP id 7C4988B9C04 for ; Tue, 8 Feb 2005 13:39:00 +0000 (GMT) Received: from user-1120vgk.dsl.mindspring.com ([66.32.126.20] helo=[192.168.1.10]) by a2s1.a2webhosting.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.44) id 1CyVZz-0003iE-PG; Tue, 08 Feb 2005 08:38:59 -0500 In-Reply-To: <007501c50db5$c6e204f0$0b00a8c0@forge> References: <007501c50db5$c6e204f0$0b00a8c0@forge> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable Cc: From: John DeSoi Subject: Re: Win32 Postgresql Command Line Password Specification Date: Tue, 8 Feb 2005 08:38:42 -0500 To: "Andrei Bintintan" X-Mailer: Apple Mail (2.619) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - a2s1.a2webhosting.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pgedit.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.016 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/66 X-Sequence-Number: 16234 On Feb 8, 2005, at 3:11 AM, Andrei Bintintan wrote: > > I have to run some command line commands that I have to run on a=20 > windows machine. Like pgsql, dropdb, createdb etc. > All these commands are runned from a php scripts. > =A0 > Now, my question is how can I specify a User and Password to=20 > postgresql database system. I found out how can I say the user, but=20 > the password is always asked in the command line. I need this also to=20= > be specified in the command. The recommended method is to use the pgpass.conf file on Windows: http://www.postgresql.org/docs/8.0/interactive/libpq-pgpass.html There is also a PGPASSWORD environment variable, but this is=20 depreciated for security reasons. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL