My intention is to have my user (tim) be able to get and put files in /var/ftp. The problem is that when I attempt to put a file, I get the following error:
553 Could not create file.
I’ve tried various combinations of permissions and owner for the directory /var/ftp to no avail. I’ve made both my user (tim) and user vsftpd the owner and have also tried setting permissions to 777 but nothing seems to work.
Here’s a sample of a session in case it reveals any issues:
[tim@washburne:~]$ ftp localhost
Connected to localhost.
220 (vsFTPd 3.0.5)
Name (localhost:tim):
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> put /home/tim/Desktop/test.txt
200 EPRT command successful. Consider using EPSV.
553 Could not create file.
ftp>
$ date > example-file
$ ftp --passive example-user@localhost
Connected to localhost.
220 (vsFTPd 3.0.5)
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/var/ftp" is the current directory
ftp> put example-file
229 Entering Extended Passive Mode (|||29727|)
150 Ok to send data.
226 Transfer complete.
26 bytes sent in 3.8e-05 seconds (668 kbytes/s)
ftp> 221 Goodbye.
$ sudo nixos-container root-login example-system
[root@example-system:~]# ls -lha /var/ftp
total 4.0K
drwxrws--- 2 vsftpd vsftpd 60 Dec 27 11:10 .
drwxr-xr-x 10 root root 260 Dec 27 11:09 ..
-rw-rw---- 1 example-user vsftpd 26 Dec 27 11:10 example-file
The manual says local_root can fail silently, so maybe have a look at pwd?