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

Posted May 3, 2017 5.2k views
ApacheUbuntu 16.04


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.


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.

Submit an Answer
2 answers

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.

by Etel Sverdlov
Vsftpd is a fast and secure FTP server. Installing an FTP server can assist you with uploading files to your droplet. This tutorial describes how to install and set up vsftpd on Ubuntu 12.04.

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!

by Justin Ellingwood
WordPress is the most popular CMS (content management system) on the internet. It allows you to easily set up flexible blogs and websites on top of a MySQL backend with PHP processing. WordPress has seen incredible adoption and is a great choice for getting a website up and...