Question

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

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: priv_sock_get_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).

Subscribe
Share

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.

I was able to do what I needed in an easy enough way by following the article here: [https://www.ducea.com/2006/07/27/allowing-ftp-access-to-files-outside-the-home-directory-chroot/]

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:

https://www.digitalocean.com/community/tutorials/how-to-set-up-vsftpd-for-a-user-s-directory-on-ubuntu-18-04

It should help you out pretty well.

Regards, KFSys