File Transfer Protocol or FTP is very popular file and data transfer protocol in IT. FTP is simple and fast protocol and used to provide files for download or upload. Linux distributions provides different FTP servers for installation. In this tutorial we will look vsftpd
ftp daemon.
文件传输协议或FTP是IT中非常流行的文件和数据传输协议。 FTP是一种简单而快速的协议,用于提供文件的下载或上传。 Linux发行版提供了不同的FTP服务器进行安装。 在本教程中,我们将看vsftpd
ftp守护程序。
为Ubuntu和Debian安装Vsftpd (Install Vsftpd For Ubuntu and Debian)
We will install vstfpd for Ubuntu and Debian systems with apt
command like below.
我们将使用如下所示的apt
命令为Ubuntu和Debian系统安装vstfpd。
$ apt install vsftpd
为CentOS,Fedora和RHEL安装Vsftpd (Install Vsftpd For CentOS, Fedora and RHEL)
We will install vsftpd for CentOS, Fedora and RHEL systems by using yum
if dnf
issupported we can use dnf
too according to yum
.
如果支持dnf
,我们将使用yum
为CentOS,Fedora和RHEL系统安装vsftpd,根据yum
我们也可以使用dnf
。
$ yum install vsftpd
Vsftpd配置文件 (Vsftpd Configuration File)
Vsftpd daemon configuration file can be found at /etc/vsftpd/vsftpd.conf .There are a lot of different type of configuration but we will look some popular of them in this tutorial. We need root privileges in order to modify vsftpd configuration file.
可以在/etc/vsftpd/vsftpd.conf中找到Vsftpd守护程序配置文件。有许多不同类型的配置,但在本教程中我们会发现其中一些流行的配置。 我们需要root特权才能修改vsftpd配置文件。
启动Vsftpd服务 (Start Vsftpd Service)
By default vsftpd daemon service do not start automatically after installation. We will start vsftpd service daemon with the following command.
默认情况下,vsftpd守护程序服务在安装后不会自动启动。 我们将使用以下命令启动vsftpd服务守护程序。
$ systemctl start vsftpd
检查Vsftpd服务 (Check Vsftpd Service)
After starting vsftpd daemon service we should check whether is start successfully. We will use systemctl status
command for this.
启动vsftpd守护程序服务后,我们应该检查启动是否成功。 我们将为此使用systemctl status
命令。
$ systemctl status vsftpd
We can see from output that it is started without a problem.
从输出中我们可以看到它没有问题地启动了。
在启动时启用自动启动Vsftpd服务 (Enable Automatic Start Vsftpd Service On Startup)
After a system restart or init level change the vsftpd daemon service will not start automatically. We should start it manually. This is not practical solutions for servers or bulk systems. We will enable the vsftpd daemon service start automatically in system start with the system enable
command.
系统重新启动或更改初始级别后,vsftpd守护程序服务将不会自动启动。 我们应该手动启动它。 对于服务器或批量系统,这不是实际的解决方案。 我们将使用system enable
命令在系统启动时自动启用vsftpd守护程序服务。
$ systemctl enable vsftpd
启用匿名访问 (Enable Anonymous Access)
One of the most popular use case for FTP servers is anonymous access. Anonymous access means without authentications access where everyone can access to the FTP file system. We can enable anonymous access for vsftpd with anonymous_enable
configuration.
FTP服务器最流行的用例之一是匿名访问。 匿名访问意味着无需身份验证即可访问,每个人都可以访问FTP文件系统。 我们可以使用anonymous_enable
配置为vsftpd启用匿名访问。
anonymous_enable=YES
启用本地系统用户 (Enable Local System Users)
By default user authentication database is created by vsftpd and all incoming connections are authentication with this database. If we need to use current local Linux system users we should use local_enable
configuration.
默认情况下,用户身份验证数据库由vsftpd创建,并且所有传入连接均与此数据库一起进行身份验证。 如果我们需要使用当前的本地Linux系统用户,则应该使用local_enable
配置。
local_enable=YES