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.
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.
WHY CAN’T I DISABLE ANONYMOUS LOGINS????? WTF????????????????
Hey there KARL, no need for getting so worked up. To disable the anonymous logins , goto ‘/etc/vsftpd/vsftpd.conf’ & look for section with ‘anonymous_enable=YES’ & change it to ‘anonymous_enable=NO’.
Also look for ‘anon_upload_enable=YES’ & changes it to ‘anon_upload_enable=NO’. Save the file & restart the service to implement the changes.
This solution is tested & should work for you as well.Please let us know.
Your Tutorial is very helpful. Thank a lot!