Information
FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server). FreeBSD ships with one basic ftpd in the base system and there is also the famous vsftpd available through package.
FTP does not protect the confidentiality of data or authentication credentials. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface.
Solution
Run the following commands to stop vsftpd / vsftpd6 and remove vsftpd packages:
# service onestop vsftpd
# service onestop vsftpd6
# pkg remove -g 'vsftpd*'
-OR-
-IF- the packages is required as a dependency:
Run the following commands to stop and disable the vsftpd or vsftpd6 service:
# service vsftpd onestop
# service vsftpd6 onestop
# service vsftpd onedisable
# service vsftpd6 onedisable
Note: Other ftp server packages may exist. If not required and authorized by local site policy, they should also be removed. If the package is required for a dependency, the service should be stopped and disabled.
Impact:
ftpd from the base system is run through inetd server which cannot be removed but disabled.
There may be packages that are dependent on the vsftpd-ext or vsftpd-ssl package. If the packages are removed, these dependent packages will be removed as well. Before removing the packages, review any dependent packages to determine if they are required on the system.
-IF- a dependent package is required: stop and disable the vsftpd and vsftpd6 services leaving the packages installed.