title: How can I be denied access to a postgres directory even with sudo?
body: <p>I need to get access to <code>pg_hba.conf</code> to try and fix my broken postgres development db that gives the error on <code>RAILS_ENV=development rails s</code> of </p>
  
  <pre><code>PG::ConnectionBad
  fe_sendauth: no password supplied
  </code></pre>
  
  <p>This post at least seems to suggest that such access may help: <a href="https://stackoverflow.com/questions/23375740/pgconnectionbad-fe-sendauth-no-password-supplied">PG::ConnectionBad: fe_sendauth: no password supplied</a></p>
  
  <p>The problem is, even though I know the path </p>
  
  <pre><code>/Library/PostgreSQL/9.3/data/pg_hba.conf
  </code></pre>
  
  <p>When I actually try to cd into it:</p>
  
  <pre><code>cd /Library/PostgreSQL/9.3/data/
  </code></pre>
  
  <p>I get: <code>cd:cd:13: permission denied: /Library/PostgreSQL/9.3/data/</code></p>
  
  <p>The seemingly obvious fix would be to sudo, so I try that:</p>
  
  <pre><code>sudo cd /Library/PostgreSQL/9.3/data/
  </code></pre>
  
  <p>And nothing happens. Literally the next line shows that I'm still exactly where I was. How can sudo be denied? And how can I either access this file or fix my issue?</p>
  
  <p>Thanks!</p>