问题是,vsftpd服务在从另一台服务器传输工作配置后无法启动。
在vsftpd的S配置文件中,只有这些配置文件被修改:
/etc/vsftpd.chroot_list以添加本地用户名。/etc/vsftpd/vsftpd.conf配置如下所示,(*)指示发行版默认值的更改或添加:
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
ftpd_banner=Hello.
listen=YES (*)
listen_ipv6=NO (*)
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
dual_log_enable=YES
use_localtime=YES (*)
rsa_cert_file=/path/to/vsftpd.crt (*)
rsa_private_key_file=/path/to/vsftpd.key (*)
ssl_enable=YES (*)
allow_anon_ssl=NO (*)
force_local_data_ssl=NO (*)
force_local_logins_ssl=NO (*)
ssl_tlsv1=YES (*)
ssl_sslv2=NO (*)
ssl_sslv3=NO (*)
require_ssl_reuse=NO (*)
ssl_ciphers=HIGH (*)
ssl_tlsv1_1=YES (*)
ssl_tlsv1_2=YES (*)
allow_writeable_chroot=YES (*)强调了配置是从一个工作的vsftpd实例移植的。工作vsftpd-2.2.2-24.el6.x86_64实例在RHEL 6 (CentOS 6)上,新的vsftpd-3.0.2-22.el7.x86_64实例在RHEL 7 (CentOS 7)上。实际上,在另一台服务器上启动了一个非常类似的配置。
VSFTP未能启动CentOS 7是没有帮助的。不需要设置listen_ipv6=YES,因为只要求listen_ipv6或listen中的一个设置为是,而另一个设置为否。此外,虽然在最初的工作配置中不存在allow_writeable_chroot=YES,但不需要简单地启动vsftpd (尽管必须解决与将配置从RHEL 6迁移到RHEL 7有关的另一个问题)。
$ sudo systemctl status vsftpd
* vsftpd.service - Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled;
vendor preset: disabled)
Active: inactive (dead)
$ sudo systemctl enable vsftpd
Created symlink from /etc/systemd/system/multi-user.target.wants/
vsftpd.service to /usr/lib/systemd/system/vsftpd.service.
$ sudo systemctl start vsftpd
Job for vsftpd.service failed because the control process exited with
error code. See "systemctl status vsftpd.service" and "journalctl -xe"
for details.
$ sudo systemctl -l status vsftpd
* vsftpd.service - Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled;
vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2018-07-31 22:07:56 CDT;
6min ago
Process: 10131 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
(code=exited, status=2)
Jul 31 22:07:56 host.example.com systemd[1]: Starting Vsftpd ftp daemon...
Jul 31 22:07:56 host.domain.tld systemd[1]: vsftpd.service: control process exited, code=exited status=2
Jul 31 22:07:56 host.domain.tld systemd[1]: Failed to start Vsftpd ftp daemon.
Jul 31 22:07:56 host.domain.tld systemd[1]: Unit vsftpd.service entered failed state.
Jul 31 22:07:56 host.domain.tld systemd[1]: vsftpd.service failed.
$ sudo journalct -xe
Jul 31 22:23:33 host.domain.tld sudo[11537]: user : TTY=pts/0 ; PWD=/etc/vsftpd ; USER=root ; COMMAND=/bin/systemctl start vsftpd
Jul 31 22:23:33 host.domain.tld polkitd[697]: Registered Authentication Agent for unix-process:11538:187361910 (system bus name :1.13901 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, loc
Jul 31 22:23:33 host.domain.tld systemd[1]: Starting Vsftpd ftp daemon...
-- Subject: Unit vsftpd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit vsftpd.service has begun starting up.
Jul 31 22:23:33 host.domain.tld systemd[1]: vsftpd.service: control process exited, code=exited status=2
Jul 31 22:23:33 host.domain.tld systemd[1]: Failed to start Vsftpd ftp daemon.
-- Subject: Unit vsftpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit vsftpd.service has failed.
--
-- The result is failed.
Jul 31 22:23:33 host.domain.tld systemd[1]: Unit vsftpd.service entered failed state.
Jul 31 22:23:33 host.domain.tld systemd[1]: vsftpd.service failed.发布于 2018-08-01 14:32:02
在这种情况下,幸运的是,另一台服务器已经成功地以非常类似的工作配置启动,因此在概念上可以进行故障排除以寻找差异。
解决方案:绝对确保配置引用的任何文件确实存在(或服务器可以访问)。例如:
rsa_cert_file=/path/to/vsftpd.crt
rsa_private_key_file=/path/to/vsftpd.key在工作安装中,密钥已经作为站站web服务器的一部分转移到系统,但是在这个系统上,vsftpd位于一个尚未同步的位置。
填充.crt和.key文件解决了此错误。
https://serverfault.com/questions/924456
复制相似问题