I'm trying to install tentd-admin.
The install fails during this step:
$ DATABASE_URL=postgres://localhost/tent_server bundle exec rake db:migrate
I also tried this:
$ DATABASE_URL=postgres://tent:tent@localhost/tent_server bundle exec rake db:migrate
The error message I got is:
Error: Sequel::DatabaseConnectionError: PG::Error: FATAL: Ident authentication failed for user "tent"
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/sequel-3.43.0/lib/sequel/adapters/postgres.rb:208:in `initialize'
My Postgres setup looks like:
$ cat ~/.pgpass
localhost:5432:tent_server:tent:tent
postgres=# CREATE USER tent WITH password 'tent';
CREATE ROLE
postgres=# CREATE DATABASE tent_server with OWNER tent;
CREATE DATABASE
Problem
FATAL: Ident authentication failed for user "tent"
Postgres is trying to use
ident
authentication, and it's not working as expected.Solution
pg_hba.conf
and the section onident
authentication.ident
authentication is not what you want and configure something more appropriate.identd
daemon to work as Postgres expects.Recommendation
ident
authentication is pretty lousy (it's client-based security and lying about who you are is trivial for an attacker).Configure one of the many other authentication methods (with actual security) instead.
Alternatively, connect to a local (unix) socket using
trust
authentication if you prefer (but note that this has security implications of its own).