【问题标题】:500 OOPS: cannot open config file:/etc/vsftpd/vsftpd.conf500 OOPS:无法打开配置文件:/etc/vsftpd/vsftpd.conf
【发布时间】:2013-07-30 07:23:10
【问题描述】:

我不知道为什么它无法打开配置文件。

$ ll /etc/vsftpd/vsftpd.conf
-rw-r--r-- 1 xuehui1 root 4182 Aug 20  2012 /etc/vsftpd/vsftpd.conf //exits
$ sudo /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
500 OOPS: cannot open config file:/etc/vsftpd/vsftpd.conf

这是 vsftpd.conf,它在其他 linux 机器 (centos) 上运行良好,但这个?任何帮助将不胜感激..

# Example config file /etc/vsftpd/vsftpd.conf
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can have your log file in standard ftpd xferlog format
xferlog_std_format=YES
#
chroot_local_user=YES
pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES
use_localtime=YES

【问题讨论】:

  • 面临同样的问题.. 有什么解决方案吗?
  • sudo chown root /etc/vsftpd/vsftpd.conf

标签: ftp-server


【解决方案1】:

这是关于文件所有者的问题。你应该为配置/etc/vsftpd/vsftpd.conf设置正确的所有者

sudo chown root /etc/vsftpd/vsftpd.conf

【讨论】:

  • 糟糕...没有以sudo 运行service 是root 的原因。 :p
【解决方案2】:

使用service vsftpd [start/restart/stop],而不仅仅是vsftpd [start/restart/stop]

【讨论】:

    【解决方案3】:

    根据操作系统的不同,您可能会因为运行不正确的命令而收到以下错误。 例如,我在 Linux Mint 15 中运行了以下命令:

    sudo vsftpd restart
    

    我收到的输出是:

    500 OOPS: cannot read config file: restart
    

    重启 vsftpd 守护进程的正确命令是:

    sudo restart vsftpd 
    

    这给出了输出:

    vsftpd start/running, process 2231
    

    【讨论】:

      【解决方案4】:

      我的解决方案是使用 systemctl 命令启动 vsftpd。

      sudo systemctl start vsftpd
      

      【讨论】:

        【解决方案5】:

        您可能会收到此错误,因为 xinetd ftp 正在运行。

        下面提到的过程将解决以下错误:

        • vsftpd 错误:500 OOPS:无法绑定监听 IPv4 套接字
        • ncftpget 错误:连接后服务器立即挂断

        按照以下步骤纠正错误:

        1. 查看正在运行的 ftp 服务使用

          • $ lsof -i | grep ftp
        2. 停止 xinetd :

          • $ sudo service xinetd stop
        3. 停止 xinetd 后,输入以下命令重新启动 vsftpd 服务:

          • $ /etc/init.d/vsftpd restart(成为root并运行此命令)
        4. 还要检查 vsftpd.conf 这个文件

          • listen=YES

          • local_enable=YES

          • write_enable=YES

          • local_umask=022

          • dirmessage_enable=YES

          • use_localtime=YES

          • xferlog_enable=YES

          • secure_chroot_dir=/var/run/vsftpd/empty

          • pam_service_name=vsftpd

          • rsa_cert_file=/etc/ssl/private/vsftpd.pem

        【讨论】:

          【解决方案6】:

          这对我有用

          sudo restart vsftpd
          

          【讨论】:

            【解决方案7】:

            在 macOS 上,新安装的 vsftpd 进程失败并显示该消息。我必须告诉它我的配置文件在哪里:

            $ sudo vsftpd/3.0.3/sbin/vsftpd /etc/vsftpd.conf & [1] 5735

            【讨论】:

              【解决方案8】:

              这对我有用:

              sudo systemctl restart vsftpd.service
              

              【讨论】:

                【解决方案9】:

                我做到了

                sudo dpkg-reconfigure vsftpd
                

                【讨论】:

                  猜你喜欢
                  • 2019-04-15
                  • 2012-07-03
                  • 2021-01-29
                  • 2014-04-20
                  • 2022-11-10
                  • 1970-01-01
                  • 2014-05-04
                  • 1970-01-01
                  • 2012-01-05
                  相关资源
                  最近更新 更多