In our earlier tutorial, we discussed how to install & configure VSFTP without anonymous access. In this tutorial, we will discuss anonymous & selected user access to our VSFTP server.

Now, let's discuss configuring our VSFTP with anonymous access 'enabled'.

Configuration

We must first allow Anonymous access to the configuration file. So open configuration file

# vi /etc/vsftpd/vsftpd.conf

then,  enable anonymous access

anonymous_enable=YES

restart server to implement changes.

https://services.vlitag.com/vpaid/?q=9ba3f2539ddb6b2df45a4f25fbfd7843&defaultVolume=&page_url=https://linuxtechlab.com

This should allow anonymous access to our FTP server.But that only gives access to the server, user won't be able to upload any files there because file permissions are still not set for anonymous users.

To enable anonymous upload, we will firstly give all permissions to /etc/ftp/pub

# chmod 777 /etc/ftp/pub

Then we make changes in the configuration file

ano_upload=yes

If using SElinux, use the following commands to set SELinux boolean values

getsebool -a grep ftp

and change the result to

setsebool -p allow_ftpd_full_access=1

restart service & our anonymous access user will now be able to upload files to ftp server.


Blocking access to user

In order to block access for a user (or users). Open /etc/vsftpd/ftpusers

# vi /etc/vsftpd/ftpusers

and add the users you wish to block access to FTP. Save the file and restart the server to implement changes,

# service vsftpd restart

This will restrict the users mentioned in file to access our VSFTP server.


Allowing only a few users access

We can also configure our server to allow access to only few users & block rest of the users. To do this, open VSFTP configuration file

# vi /etc/vsftpd/vsftpd.conf

and make following changes

userlist_deny=no

save the file & now open,

# vi /etc/vsftpd/user_list

and add users that you want to grant access to the ftp in seperate lines.

susan
bob
daniel

Save the file & restart the service.

That's it guys, that concludes our tutorial for VSFTP. If you want to know more options for file sharing, you can also read my tutorial on NFS (Network File System). Please guys don't forget to provide your much-needed feedback or queries down below.

If you think we have helped you or just want to support us, please consider these :-

Connect to us: Facebook | Twitter |

Linux TechLab is thankful for your continued support.