VSFTPD in ubuntu 18.04 .. Cannot access directory filezilla

January 18, 2019 3.4k views
Ubuntu 18.04 Getting Started

Installed nginx on 18.04
installed vsftpd (change only: write_enable=YES)
created a server block
assigned ownership the ftpuser (brillftp) to server block directory.

here is the filezilla log:
Status: Connection established, waiting for welcome message…
Status: Server does not support non-ASCII characters.
Status: Logged in
Status: Retrieving directory listing…
Command: PWD
Response: 257 “/home/brillftp” is the current directory
Command: TYPE I
Response: 200 Switching to Binary mode.
Command: PASV
Response: 227 Entering Passive Mode (142,94,81,13,47,231).
Command: LIST
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing
Status: Disconnected from server

Used the same procedure in UBUNTU 16.04 did not have this problem

Thanks,

1 Answer

There are a few changes you have to make to the vsftpd configuration file before you can start using FTP on Ubuntu 18.04.

Before editing the config file, create a backup.

sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.bak

Now, open the config file in nano editor.

sudo nano /etc/vsftpd.conf

Look for #write_enable=YES and uncomment it by removing the # sign. This will allow FTP users to write files to the server.

write_enable=YES

Look for #chroot_local_user=YES and uncomment it by removing the # sign. This will prevent FTP users from browsing outside their own directory.

chroot_local_user=YES

Look for #local_umask=022 and uncomment it by removing the # sign. This will give uploaded files and folders the correct permissions.

local_umask=022

Since Linux doesn’t show files beginning with a dot, files like .htaccess will not be visible in FTP. This may be a problem if you intend to use Apache and want to work with .htaccess.

To force vsftpd to show file names that begin with a dot, paste the following to the bottom of the file.

force_dot_files=YES

Lastly, let’s add some port ranges for passive FTP to make sure enough connections are available.

pasv_min_port=40000
pasv_max_port=50000

To save file and exit, press CTRL + X, press Y and then press ENTER.

Restart vsftpd.

sudo systemctl restart vsftpd
Have another answer? Share your knowledge.