File '/etc/gonit/gonitrc' must have permissions no more than -rwx------; right now permissions are -rwx----w-

Keywords: WordPress - AWS - Technical issue - Permissions
Description:
Hey folks,

I actually amended the permission of the /opt/bitnami/ folder using
sudo chmod -R o+w /opt/bitnami/

Now when I restarted the Apache, I got the above warning in the subject, but it restarted the server without any hassle.

The warning I get is
file '/etc/gonit/gonitrc' must have permissions no more than -rwx------; right now permissions are -rwx----w-.

Now when I read on the Internet and a few forum post, I got a suggestion to actually use this command to reverse it.
sudo chmod -R o-w /opt/bitnami/
which actually worked to remove the warning.

However, after a few hours, I got the
Error establishing database connection

I found out from the logs that a few folders within the bitnami folder were not writable.
Find below the errors in the mysqld.log file
mysqld.bin: Can't create/write to file '/opt/bitnami/mysql/tmp/ibbD6suZ' (OS er rno 13 - Permission denied) 2021-06-08T [ERROR] [MY-012576] [InnoDB] Unable to create tem porary file; errno: 13 2021-06-08T [ERROR] [MY-012930] [InnoDB] Plugin initializatio n aborted with error Generic error. 2021-06-08T [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2021-06-08T ERROR] [MY-010020] [Server] Data Dictionary init ialization failed. 2021-06-08T [ERROR] [MY-010119] [Server] Aborting 2021-06-08T [System] [MY-010910] [Server] /opt/bitnami/mysql/ bin/mysqld.bin: Shutdown complete (mysqld 8.0.23) MySQL Community Server - GPL

I realized that it is because of the code that I wrote o-w which was problematic.

So I used sudo chmod -R o+w /opt/bitnami/ again and the site started working but the warning in the subject started coming again.

My question is: What is the optimal or original permission that I should set for the /opt/bitnami/ folder?

Hi @keyuramin08

Thanks for using Bitnami WordPress!

What is the optimal or original permission that I should set for the /opt/bitnami/ folder?

You can learn more about the default permissions and users of a Bitnami stack in this article:
https://docs.bitnami.com/general/how-to/troubleshoot-permission-issues/

The /opt/bitnami/ folder itself should NOT be writable by others. This does not imply that specific folders within it shouldn’t have this either.

sudo chmod -R o+w /opt/bitnami/

The -R flag makes the operation be applied recursively. That is, the /opt/bitnami and all its content will be granted writing permissions to other users different than the owner or group.

If you want the warning to disappear, change the permissions exclusively to the /etc/gonit/gonitrc file:

sudo chmod o-w /etc/gonit/gonitrc

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

1 Like