title: mongodb keyfile permission denied
body: <p>I configured in <code>/etc/mongod.conf</code> to enforce keyfile access control, in <code>security</code> option enabled, <code>keyFile</code> is <code>/root/dbtest.key</code> (the absolute path of keyfile). I already gave the ownership to <code>mongodb</code> user by <code>chown</code>, and granted <code>400</code> permission on that <code>dbtest.key</code> file.</p>
  
  <p>But <code>mongod</code> keeps failing to start, after checking log, the error is <code>Error reading file /root/dbtest.key: Permission denied</code>. After checking the ownership and permissions on <code>dbtest.key</code></p>
  
  <p><a href="https://i.stack.imgur.com/bN0pO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bN0pO.png" alt=""></a></p>
  
  <p>Which means I already granted correctly. So I don't know at which step I did wrong</p>