无法启动 vsftpd。 vsftpd:必须以 root 身份启动

无法启动 vsftpd。 vsftpd:必须以 root 身份启动

我无法启动我的vsftpd,如下图:

guoyanzhang@debian:~$ sudo service vsftpd status
● vsftpd.service - vsftpd FTP server
    Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Wed 2020-08-05 15:47:07 HDT; 1min 30s ago
    Process: 4066 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited, status=0/SUCCESS)
    Process: 4067 ExecStart=/usr/sbin/vsftpd /etc/vsftpd.conf (code=exited, status=2)
    Main PID: 4067 (code=exited, status=2)

Aug 05 15:47:07 debian systemd[1]: Starting vsftpd FTP server...
Aug 05 15:47:07 debian systemd[1]: Started vsftpd FTP server.
Aug 05 15:47:07 debian systemd[1]: vsftpd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 05 15:47:07 debian systemd[1]: vsftpd.service: Failed with result 'exit-code'.
guoyanzhang@debian:~$ sudo vim /etc/vsftpd.conf
guoyanzhang@debian:~$ /etc/init.d/vsftpd restart
[....] Restarting vsftpd (via systemctl): vsftpd.service====AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'vsftpd.service'.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ===
. ok
guoyanzhang@debian:~$ /usr/sbin/vsftpd /etc/vsftpd.conf
500 OOPS: vsftpd: must be started as root (see run_as_launching_user option)
guoyanzhang@debian:~$ sudo cat /etc/vsftpd.conf
#begin my configurations
listen=YES
listen_address=192.168.1.108
connect_from_port_20=YES
anonymous_enable=NO
chroot_local_user=YES
use_localtime=YES
local_enable=YES 
local_root=/home/guoyanzhang/share/myftp
xferlog_enable=YES
local_umask=022
#end my configurations

答案1

该错误是不言自明的。您必须按照手册所述运行root或使用run_as_launching_user选项:vsftpd.conf

run_as_launching_user 如果您希望 vsftpd 以启动 vsftpd 的用户身份运行,请设置为 YES。这在 root 访问不可用的情况下非常有用。

请注意,启用此选项可能会构成安全威胁,因为chroot_local_user您当前使用的选项和run_as_launching_user选项是互斥的

相关内容