title: Postgres password authentication issue
body: <p>I've installed PostgreSQL 9.1 and pgadmin3 on Ubuntu Server 13.10.</p>
  
  <p>I configured postgresql.conf with: <code>listen_addresses = '*'</code></p>
  
  <p>also I configured ph_hba.conf by changed peer connections to <code>md5</code></p>
  
  <p>Plus I reset the password of postgres by: <code>sudo password postgres</code></p>
  
  <p>then restarted the service with <code>sudo /etc/init.d/postgresql restart</code></p>
  
  <p>after that I tried to connect to the default PostgreSQL template database:</p>
  
  <pre><code>sudo -u postgres psql template1
  </code></pre>
  
  <p>but login failed with this error message: </p>
  
  <pre><code>psql: FATAL:  password authentication failed for user "postgres"
  </code></pre>
  
  <p>then I tried to login from the pgadmin, which gave me the same error.</p>
  
  <p>I've read here that it might be a password expiry dates bug
  <a href="https://dba.stackexchange.com/questions/36137/postgresql-user-can-not-connect-to-server-after-changing-password">PostgreSQL user can not connect to server after changing password</a></p>
  
  <p>but I couldn't solve it coz I cannot login with psql. Does anyone now how to resolve this issue?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>ph_hba file:</p>
  
  <pre><code>local   all             postgres                                md5
  local   all             all                                     md5
  local   all             all                                     trust
  
  host    all             all             127.0.0.1/32            md5
  hostssl all             all             192.168.0.0/16          trust
  host    all             all             192.168.0.0/16          trust
  
  host    all             all             ::1/128                 md5
  </code></pre>