how to run psql without password prompt when using auth MD5/Password

Started by eyal edrialmost 15 years ago4 messagesgeneral
Jump to latest
#1eyal edri
eyal.edri@gmail.com

Hi,

Is there a way to run psql -U user -d dbname -c "select....."

without the psql asking for a password prompt from the user?

when setting the pg_hba.conf file to use md5 or password.

(btw, i've tried using ident, but couldn't make it work with jboss).

thanks!

Eyal.

#2Grzegorz Szpetkowski
gszpetkowski@gmail.com
In reply to: eyal edri (#1)
Re: how to run psql without password prompt when using auth MD5/Password

Sure,

http://stackoverflow.com/questions/6216432/windows-psql-command-line-is-there-a-way-to-allow-for-passwordless-login/6216838#6216838

Regards,
Grzegorz Szpetkowski

2011/6/5 eyal edri <eyal.edri@gmail.com>:

Show quoted text

Hi,
Is there a way to run psql -U user -d dbname -c "select....."
without the psql asking for a password prompt from the user?
when setting the pg_hba.conf file to use md5 or password.
(btw, i've tried using ident, but couldn't make it work with jboss).
thanks!
Eyal.

#3eyal edri
eyal.edri@gmail.com
In reply to: Grzegorz Szpetkowski (#2)
Re: how to run psql without password prompt when using auth MD5/Password

of course trust is a way :)

but i need a more secure way, as my company requires.. like md5.
only i want to be able to enter the password in the command line and not be
promoted (so a script can do it).

eyal

On Sun, Jun 5, 2011 at 2:21 PM, Grzegorz Szpetkowski <gszpetkowski@gmail.com

Show quoted text

wrote:

Sure,

http://stackoverflow.com/questions/6216432/windows-psql-command-line-is-there-a-way-to-allow-for-passwordless-login/6216838#6216838

Regards,
Grzegorz Szpetkowski

2011/6/5 eyal edri <eyal.edri@gmail.com>:

Hi,
Is there a way to run psql -U user -d dbname -c "select....."
without the psql asking for a password prompt from the user?
when setting the pg_hba.conf file to use md5 or password.
(btw, i've tried using ident, but couldn't make it work with jboss).
thanks!
Eyal.

#4eyal edri
eyal.edri@gmail.com
In reply to: eyal edri (#3)
Re: how to run psql without password prompt when using auth MD5/Password

sorry, didn't saw the other option.

setting PGPASSWORD does the trick, even with md5.

thanks!!

E.

On Sun, Jun 5, 2011 at 2:28 PM, eyal edri <eyal.edri@gmail.com> wrote:

Show quoted text

of course trust is a way :)

but i need a more secure way, as my company requires.. like md5.
only i want to be able to enter the password in the command line and not be
promoted (so a script can do it).

eyal

On Sun, Jun 5, 2011 at 2:21 PM, Grzegorz Szpetkowski <
gszpetkowski@gmail.com> wrote:

Sure,

http://stackoverflow.com/questions/6216432/windows-psql-command-line-is-there-a-way-to-allow-for-passwordless-login/6216838#6216838

Regards,
Grzegorz Szpetkowski

2011/6/5 eyal edri <eyal.edri@gmail.com>:

Hi,
Is there a way to run psql -U user -d dbname -c "select....."
without the psql asking for a password prompt from the user?
when setting the pg_hba.conf file to use md5 or password.
(btw, i've tried using ident, but couldn't make it work with jboss).
thanks!
Eyal.