Sample Header Ad - 728x90

Why is permission denied for the MongoDB keyfile stored in the root user home directory?

3 votes
1 answer
2626 views
I configured in /etc/mongod.conf to enforce keyfile access control, in security option enabled, keyFile is /root/dbtest.key (the absolute path of keyfile). I already gave the ownership to mongodb user by chown, and granted 400 permission on that dbtest.key file. But mongod keeps failing to start, after checking log, the error is Error reading file /root/dbtest.key: Permission denied. After checking the ownership and permissions on dbtest.key Image Which means I already granted correctly. So I don't know at which step I did wrong
Asked by necroface (139 rep)
Aug 2, 2019, 03:12 AM
Last activity: Aug 6, 2025, 10:13 PM