Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated postgres client auth configuration file do not allow to login with username and password #4

Open
hzmangel opened this issue May 10, 2013 · 2 comments

Comments

@hzmangel
Copy link

The generated postgres configuration file /etc/postgresql/8.4/main/pg_hba.conf uses ident for authentication of user accessed though unix socket, which will cause Ident authentication failed error if using specified username not added to ident map. Which means database connection will not be able to established if the web server and database server was deployed on the same node.

I am wondering whether this can be set to md5 as access over network does, which can enable authentication with username and password on unix socket.

@hzmangel
Copy link
Author

The configuration using ident for unix domain is hard coded in postgresql default template downloaded from opscode community. This line is guarantee the Chef can connect to database without password, which is described in the readme file.

The simplest workaround for this issue is adding host: localhost field in the apps using local postgresql for backend database, which should be mentioned in the document.

@mbixby
Copy link

mbixby commented Mar 15, 2014

Specifying host: localhost helped? I had to change ident/peer to md5 manually.

By the way, this line in databox postgres recipe:
{:type => 'local', :db => 'all', :user => 'all', :addr => nil, :method => 'md5'}
does nothing, see Postgres 9.1 docs:

The first record with a matching connection type, client address, requested database, and user name is used to perform authentication. There is no "fall-through" or "backup": if one record is chosen and the authentication fails, subsequent records are not considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants