By sylasdesouza
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!
@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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.