-1

On Ubuntu 16 I am trying to give FTP access to a particular server directory which has files owned by web:www-data to an FTP user.

I have changed the users home directory:

usermod --home /srv/www/example.com/current/ username

Confirmed:

grep username /etc/passwd

username:x:1002:1001:User Company,,,:/srv/www/example.com/current/:/bin/bash

When I switch users the home directory seems to be the same as the admin directory:

sudo -su username
echo $HOME
/home/admin

And when I connect via FTP

ftp -p xxx.xxx.xxx.xxx
Name: username
Password: password

It takes me to /home/username/ftp

MikeiLL
  • 247
  • 1
  • 4
  • 10

1 Answers1

0

Whoops. Looked in /etc/vsftpd.conf and lo and behold:

local_root=/home/$USER/ftp

Remove that line, restart (sudo systemctl restart vsftpd) and land in the desired directory.

Not sure how permissions will work out. I have added username to the www-data group. New to command-line FTP and still unable to connect via GUI FTP (FileZilla, Fetch).

MikeiLL
  • 247
  • 1
  • 4
  • 10