ContOS7 下配置ftp服务器,启动失败提示Failed to start Vsftpd ftp daemon.

ContOS7 下配置ftp服务器,启动失败提示
Active: failed (Result: exit-code) since 五 2020-05-22 03:23:52 CST; 1min 18s ago
Process: 10066 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=2)
Failed to start Vsftpd ftp daemon.

失败:

[root@localhost vsftpd]# systemctl status vsftpd -l
● vsftpd.service - Vsftpd ftp daemon
   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 五 2020-05-22 03:23:52 CST; 1min 18s ago
  Process: 10066 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=2)

5月 22 03:23:52 localhost.localdomain systemd[1]: Starting Vsftpd ftp daemon...
5月 22 03:23:52 localhost.localdomain vsftpd[10066]: 500 OOPS: can only support ipv4 and ipv6 currently
5月 22 03:23:52 localhost.localdomain systemd[1]: vsftpd.service: control process exited, code=exited status=2
5月 22 03:23:52 localhost.localdomain systemd[1]: Failed to start Vsftpd ftp daemon.
5月 22 03:23:52 localhost.localdomain systemd[1]: Unit vsftpd.service entered failed state.
5月 22 03:23:52 localhost.localdomain systemd[1]: vsftpd.service failed.

百度一下,大多都说是vsftpd.conf 配置文件的问题
查看了/etc/vsftpd/vsftpd.conf 配置文件,listen=NO 和 listen_ipv6=YES 一个关闭一个开启,好像没问题

[root@localhost vsftpd]# grep -v "#" vsftpd.conf
write_enable=YES

local_umask=022

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=YES

listen=NO

listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

可是 还是没解决!!

在继续百度,有说是端口被占用了,那我的是不是端口被占用了呢
那查看端口是否被占用:

[root@localhost vsftpd]# lsof -i:21
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
vsftpd  9567 root    4u  IPv6  33694      0t0  TCP *:ftp (LISTEN)

那kill 掉试试

[root@localhost vsftpd]# kill -9 9567
[root@localhost vsftpd]# lsof -i:21

那再启动ftp服务试试。啊!成功了

[root@localhost vsftpd]# systemctl start vsftpd
[root@localhost vsftpd]# systemctl status vsftpd 
● vsftpd.service - Vsftpd ftp daemon
   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; vendor preset: disabled)
   Active: active (running) since 五 2020-05-22 03:28:51 CST; 7s ago
  Process: 10082 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 10083 (vsftpd)
   CGroup: /system.slice/vsftpd.service
           └─10083 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

5月 22 03:28:51 localhost.localdomain systemd[1]: Starting Vsftpd ftp d...
5月 22 03:28:51 localhost.localdomain systemd[1]: Started Vsftpd ftp da...
Hint: Some lines were ellipsized, use -l to show in full.

参考1:https://blog.csdn.net/jyqh520/article/details/52785881
参考2:https://blog.csdn.net/qq_33862644/article/details/80589098
参考3:https://blog.csdn.net/verifocus/article/details/78913574

你可能感兴趣的:(Linux)