Allow FTP access to developers for wordpress sites

Date posted : 07/02/2019

In this blog article, we will be explaining FTP related access to wordpress sites. Generally developers used to face issues with FTP uploads or wordpress plugins installs via wp-admin.

It happens due to incorrect user/group file permissions given to wordpress files.

To accomplish this, we need to do the following:-

1. Create a new user

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ useradd devs
$ useradd devs
$ useradd devs

2. Modify user folder to point to wordpress document root

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ usermod -d /var/www/pheonixsolutions.com devs
$ usermod -d /var/www/pheonixsolutions.com devs
$ usermod -d /var/www/pheonixsolutions.com devs

3. Add user to the apache group

First you should check the username of your webserver application. Mostly it will be apache or www-data

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ usermod -a -G apache devs
$ usermod -a -G apache devs
$ usermod -a -G apache devs

4. Change ownership

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ cd /var/www/pheonixsolutions.com
$ chow devs:apache /var/www/pheonixsolutions.com -R
$ cd /var/www/pheonixsolutions.com $ chow devs:apache /var/www/pheonixsolutions.com -R
$ cd /var/www/pheonixsolutions.com
$ chow devs:apache /var/www/pheonixsolutions.com -R

5. Make files writable by user/group

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ find . -type f -exec chmod 664 {} \;
$ find . -type d -exec chmod 775 {} \;
$ find . -type f -exec chmod 664 {} \; $ find . -type d -exec chmod 775 {} \;
$ find . -type f -exec chmod 664 {} \;
$ find . -type d -exec chmod 775 {} \;

You should be able to upload files without issues. Also you can install/delete/update new plugins via wp-admin flawlessly.

Thanks for using pheonix solutions.

You find this tutorial helpful? Share with your friends to keep it alive. Be the first to comment, we value your suggestions.

For further queries please comment below.

Leave a Reply