1

Ubuntu 20.04, server.

Wanted to configure the FTPS following instructions: https://devanswers.co/install-ftp-server-vsftpd-ubuntu-20-04/

Did all actions and got error with FileZilla: Response: 500 OOPS: cannot change directory:/var/www

The problem is I did the Step 4, method #1 firstly:

sudo usermod -d /var/www ftpuser
sudo chown ftpuser:ftpuser /var/www/html

After that I did Step 4, method #2

sudo mkdir /home/ftpuser/ftp
sudo chown nobody:nogroup /home/ftpuser/ftp

sudo chmod a-w /home/ftpuser/ftp
sudo mkdir /home/ftpuser/ftp/files
sudo chown ftpuser:ftpuser /home/ftpuser/ftp/files

Only 1 method should be done. This is my mistake. I'm quite new with Ubuntu server, my apologies for stupid questions. How to upload to a Home Folder only? (Method #2) The problem is 2 lines I did before, as I understand:

sudo usermod -d /var/www ftpuser
sudo chown ftpuser:ftpuser /var/www/html
1
  • @steeldriver thank you) Jun 11, 2021 at 13:14

1 Answer 1

1

You should be able to change the home directory back and reverse the first two lines with:

sudo usermod -d /home/ftpuser ftpuser
sudo chown www-data:www-data /var/www

usermod -d sets the home folder for a user.

When configuring vsftpd you may also need to edit the /etc/vsftpd.conf file.

Change the line:

local_root=/fake/path

To:

local_root=/home/$USER/ftp/files

This should change the root directory to the path created in your example.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .