Having setup FTP I need to create a user and give access to a web page folder

Posted August 31, 2020 1.6k views

I need to create a user that has access to a web address that I’m managing on DO. I have the web server and ftp installed and running. What I would like to do is create a user whose home page is /var/www/html/severestudios and give them ftp read/write access (only to that folder).
I have followed a few tutorials indicating the following should work…

adduser <username>
usermod -d /var/www/html/severestudios <username>
chown <username>:<username> <username>
chown www-data:www-data /var/www/html/severestudios
usermod -a -G www-data <username>

I try to log in with WinSCP (standard FTP - no encryption) and either get:
OOPS: cannot change directory:/home/severestudios/ftp
or worse
OOPS: privsockget_cmd

It doesn’t make sense that it’s trying to change the directory to /home/severestudios - that is not the home directory I set, nor is it the one that appears in the /etc/passwd file (the right one is in there).

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

Hi @dandesjardins,

It seems like you have set your home directory to /home/username/. Anyway, there a few services which you can use to help you achieve that.

I’ll recommend using vsftpd as it will tremendously help you out. Additionally, DigitalOcean have a pretty good article on how to configure it:

It should help you out pretty well.


by Melissa Anderson
by Kathleen Juell
FTP, short for File Transfer Protocol, is a network protocol that was once widely used for moving files between a client and server. It has since been replaced by faster, more secure, and more convenient ways of delivering files. In this tutorial, we'll show you how to configure vsftpd to allow a user to upload files to his or her home directory using FTP with login credentials secured by SSL/TLS.
  • nice article, but it doesn’t help. As stated, I’m trying to set the users home directory to /var/www/html/severestudios. And even though I’ve entered the proper commands to do this - it continues to go to /home/severestudios/ftp. If I change the vsftp.config loacl_root that messes up everyone else.