TECHIES WORLD

For Techs.... Techniques.... Technologies....

CpanelLinuxMysql

How to enable passwordless authentication for Postgresql in Linux

PostgreSQL is a powerful, open source object-relational database system. It runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows.

Normally we need to pass the username and password to login to Postgresql shell from Linux command line. But we can enable passwordless authentication for Postgresql in Linux server.

This article explains the steps to enable passwordless authentication for Postgresql in Linux.

Step1: Change the location to users home directory

#cd ~

Step2: Open a file with name '.pgpass'

#vi .pgpass

Step3: Add the pgsql server details to this file as given below and save it

hostname:port:database:username:password

Step4: Change the permission of this file and disable the public access.

#chmod 600 .pgpass

 

That's all.......

Leave a Reply