Report this

What is the reason for this report?

Configure user vsftpd in a specific directory

Posted on March 12, 2015

Hello friends!

I am beginner and installed the LAMP package in Ubuntu, but I can not make the following settings:

I created a user named “oregon” and want to access SFTP with it, but I need that he has as root directory** /var/www** because I will publish your site files in /var/www/html. Also not want him to see above directories and preference.

Already asked for help in supporting and read the tutorials, but could not solve :(

Every moment is a different problem, I can never complete this setting, please help me.



This textbox defaults to using Markdown to format your 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.

Are you using FTP or SFTP? As far as I know, vsftpd does not support SFTP.

@Woet I am a novice, do not know what I’m doing. What do I need at the moment is: access the FTP or SFTP with the user created. As you would with handles sshd SFTP?

@redraenhys Thank you, I will perform this procedure when I was at home.

You could bind the user folder to the /html. 1. To keep it tidy create a folder in the user’s folder: mkdir -p /home/{user}/www/html where {user} should be changed to the user name. Also create the html folder in /var/www if it doesn’t exist yet.

2. Then to mount it: mount --bind /var/www/html /home/{user}/www/html

You’re basically binding these folders, as the docs states: “–bind Remount a subtree somewhere else (so that its contents are available in both places)”

3. You’ll still need to make it permanent, so: sh -c 'echo "/var/www/html /home/{user}/www/html none defaults,bind 0 0" >> /etc/fstab'

which is the equivalent to add the bind command to the /etc/fstab, so it’s executed every time your system boots.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.