Rashaad
Rashaad

Reputation: 75

How do I create a FTP user in Amazon Lightsail to update Wordpress Plugins

I successfully migrated a Wordpress site from BlueHost to AWS Lightsail. When I go to update the plugins, Wordpress is asking for FTP credentials (see the image). By default, you can only connect to the Lightsail instance via SSH Certificate, which I have successfully done via Transit.

Wordpress wants FTP infor

Upvotes: 4

Views: 4474

Answers (1)

LifeSizeActionFigure
LifeSizeActionFigure

Reputation: 41

In your lightsail firewall rules make sure you allow access to TCP ports 21 and 1024-1048 from 127.0.0.1

SSH to your Lightsail instance (use putty for windows unless you know how to edit files with vim)

run the following commands to install vsftpd.

sudo apt install vsftpd
sudo nano /etc/vsftpd.conf

uncomment these lines:

local_enable=YES
write_enable=YES

add these lines:

pasv_enable=YES
pasv_min_port=1024
pasv_max_port=1048
pasv_address=127.0.0.1

Press Ctrl+X , Y , ENTER to save the changes to the file (this is why I said to use putty)

run this command to see what group owns the wp-content directory

ls -l /home/bitnami/apps/wordpress/htdocs/

In my lightsail instance, it was the "daemon" group

Note:other articles suggest adding this user to the bitnami group, but in my experience this resulted in errors during update siting that it was not able to create directories.

Run the following to create a new user and assign it to this group so that it will have access to write to the wp-content directory.

(in the following lines, substitute ftpuser for the new username)

sudo /etc/init.d/vsftpd restart
sudo adduser ftpuser
sudo usermod -d /home/bitnami ftpuser
sudo usermod -a -G daemon ftpuser
sudo /etc/init.d/vsftpd restart

Now you can try your updates again and it should work. use 127.0.0.1 for the hostname and specify the new FTPuser credentials you just created.

Upvotes: 2

Related Questions