title: Getting authentication failed error with postgresql from command line
body: <p>When i try to login from command line like this</p>
  
  <pre><code>psql -h dbserver -U testuser test
  </code></pre>
  
  <p>then i get this error</p>
  
  <pre><code>psql: FATAL:  Ident authentication failed for user "testuser"
  </code></pre>
  
  <p>This is my  </p>
  
  <blockquote>
    <p>nano -w /var/lib/pgsql/data/pg_hba.conf</p>
  </blockquote>
  
  <pre><code># TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
  
  # "local" is for Unix domain socket connections only
  local   all         all                               ident
  # IPv4 local connections:
  host    all         all         127.0.0.1/32          password
  # IPv6 local connections:
  host    all         all         ::1/128               ident
  host    all     all     192.168.0.1/24  password
  </code></pre>