title: How to use scram-sha-256 in Postgres 10 in Debian? Getting "FATAL: password authentication failed"
body: <p>I edited <code>pg_hba.conf</code>:</p>
  
  <pre><code>sudo su postgres
  nano /etc/postgresql/10/main/pg_hba.conf
  </code></pre>
  
  <p>and added this line:</p>
  
  <pre><code>local   all             username                               scram-sha-256
  </code></pre>
  
  <p>and changed all <code>md5</code> to <code>scram-sha-256</code> in that file.</p>
  
  <p>As the <code>postgres</code> user, I created a new user with superuser rights:</p>
  
  <pre><code>sudo su postgres
  psql
  
  CREATE USER username WITH SUPERUSER PASSWORD 'password';
  </code></pre>
  
  <p>Then I restarted Postgres:</p>
  
  <pre><code>/etc/init.d/postgresql restart
  </code></pre>
  
  <p>and tried to login with pgAdmin4 where I changed the username under the database's Connection properties. But neither that nor <code>psql -U username testdb &lt; ./testdb.sql</code> work as I'm getting:</p>
  
  <blockquote>
    <p>FATAL: password authentication failed for user "username"</p>
  </blockquote>
  
  <p>So how can I get Postgres working with scram-sha-256 on my Debian9/KDE machine? It worked earlier when I left all the <code>md5</code> in <code>pg_hba.conf</code> as they were.</p>