Add temporary SFTP user restricted to /var/www/html


I need to add an SFTP user to a droplet with Apache with access to the /var/www/html directory only.

On this droplet password authentication is disabled and the ufw firewall is active.

The goal is to give temporary access to a WordPress plugin developer for troubleshooting and later revoke their access — all without reducing the security of the server.



Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Install and configure VSFTP given as per given at below link.

As you want to give access to a particular directory, please find the below step after installation of VSFTP.

By changing User’s Home directory

Make sure following line exists /etc/vsftp/vsftpd.conf


Set User HOME Directory to /var/www/html, if you want to change for existing user then you can use :

usermod --home /var/www/ username

then set required permission on /var/www/html

Kindly follow the above step and do let me know in case of any query.

Dear @omarfilip I think, you might visit this page: How To Install WordPress with LAMP on Ubuntu 16.04.

It can maybe useful for you.

Thank you!