Continued Permissions Issues on Lightsail

Keywords: WordPress - AWS - Technical issue - Permissions
bnsupport ID: 5fb04865-908c-2596-cd04-1a80a7045c2b
Description:
I’m having specific trouble with one site, but this issue seems to creep up nearly every time that I migrate an existing website to Lightsail. I inevitably run into permissions issues, asking for FTP credentials whenever I want to install a plugin, etc.

I’ve followed the guides provided by Bitnami to the letter, setting chown / chmod, and so on. Strangely, I’m able to upload Media just fine, but installing plugins continues to give me the FTP connection window / error.

I’ve run BNSupport, with the following code: 5fb04865-908c-2596-cd04-1a80a7045c2b

Any ideas?

Try putting this command in your terminal, it worked for me with FileZilla.

sudo chown -R bitnami:daemon /opt/bitnami/wordpress/wp-content

Modify the path according to where you are going to upload the files to

Thanks carbo17! I’ve tried these sorts of fixes, sadly. For whatever reason it works for wp-content/uploads but no matter what permissions I set on wp-content/plugins, I still get the FTP modal. I’m completely stumped. I’ve followed the Bitnami guides for this (sometimes repeatedly), rebooting Apache after each attempt. No luck so far.

Hi @gburkett

Thanks for using Bitnami WordPress!

I still get the FTP modal. I’m completely stumped. I’ve followed the Bitnami guides for this (sometimes repeatedly), rebooting Apache after each attempt. No luck so far.

As permission issues tend to be broad, could you please describe the steps you are following and the final goal so that I am able to reproduce it on my side?

Additionally, we have a guide that covers the most common problems regarding permissions. Indeed, you can find a specific section for FTP. I think you may find it handy :slightly_smiling_face:
https://docs.bitnami.com/general/how-to/troubleshoot-permission-issues/#you-cant-upload-a-file-via-sftp

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

Thanks @jcarmona - I suppose there’s not a lot too it, honestly. I’ve set the wp-content/plugins folder to be owned by bitnami:daemon, 775 perms. These are the same permissions as the wp-content/uploads, which is super strange, as I’m able to upload files into the Media library via admin.

However… I tried something on a whim and it works… I set the FS_METHOD to ‘direct’ in the wp-config.php file, and now installing plugins works. However, I’m curious if there are any security concerns in switching that. It was previously reporting as ‘ftpext’

I suppose there’s not a lot too it, honestly. I’ve set the wp-content/plugins folder to be owned by bitnami:daemon, 775 perms. These are the same permissions as the wp-content/uploads, which is super strange, as I’m able to upload files into the Media library via admin.

Unfortunately, I wasn’t able to face any issues installing plugins on a new instance

However… I tried something on a whim and it works… I set the FS_METHOD to ‘direct’ in the wp-config.php file, and now installing plugins works. However, I’m curious if there are any security concerns in switching that. It was previously reporting as ‘ftpext’

The original value for this setting on a new stack is indeed direct, so maybe that was the root of the issue :slightly_smiling_face: Did that completely solve your issue?

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

Thanks again Jose, for all the assistance

So I got curious about this – In Lightsail I spun up a completely NEW instance, fresh install. I was able to install plugins via the UI, but I was NOT able to edit theme files via SCP. I kept getting permission denied errors. The files of the themes (along with any other WordPress-upload files) were owned by daemon:daemon.

None of these files are editable via SCP with the bitnami user. Which makes sense I suppose. Sudo chown’ing them to daemon:bitnami allowed me to edit, but I wonder if there’s not some misconfig in the initial installation of Bitnami WordPress.

In short:

  1. Files uploaded via WP admin plugin install and theme install are (on a fresh install) daemon:daemon.
  2. All other files in the stack are daemon:bitnami
  3. To directly edit any theme files, you have to sudo chown (via shell) them to daemon:bitnami

Is this expected behavior?

Thanks again Jose, for all the assistance

My pleasure!

but I wonder if there’s not some misconfig in the initial installation of Bitnami WordPress.

I don’t see anything wrong with it, let’s review all your points:

  1. Files uploaded via WP admin plugin install and theme install are (on a fresh install) daemon:daemon.

The Apache service, which is in charge of serving WordPress, runs using the system user daemon. If you uploaded a theme/plugin using the WordPress UI, the user/group it belongs to will be daemon:daemon, it Apache is the service that created those files.

  1. All other files in the stack are daemon:bitnami

I guess you mean bitnami:daemon (owner:group). bitnami is the system user for SSH/SFTP access. Again, I see no red lights here.

  1. To directly edit any theme files, you have to sudo chown (via shell) them to daemon:bitnami

You don’t necessarily need to change the ownership to apply changes. Remember that the root user (superuser) can perform changes even if the permissions do not match. You could simply do:

$ sudo nano YOUR_FILE

That will allow you to edit it without altering the permissions

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

1 Like

Thanks again Jose, appreciate the continued assistance (and education!)… I’ve been doing dev for a long time, but am pretty new to Lightsail + Bitnami.

1 Like