centos7 配置 vsftpd 失败!

发布于 2022-08-30 16:26:24 字数 4080 浏览 36 评论 0

需求

1)让用户可以使用FTP软件登录到网站,进行上传下载
2)但是他只能看到网站下的,不能超出网站目录!

安装

用的是vsftpd

yum install vsftpd
systemctl start vsftpd
systemctl enable vsftpd

问题

按照网上说的 https://www.liberiangeek.net/2014/08/install-vsftpd-ftp-server-centos-7/ 配置vsftpd,修改了/etc/vsftpd/vsftpd.conf 重启结果一直报错:

[root@niche vsftpd]# systemctl restart vsftpd
Job for vsftpd.service failed. See 'systemctl status vsftpd.service' and 'journa                
lctl -xn' for details.
[root@niche vsftpd]# systemctl restart vsftpd.service
Job for vsftpd.service failed. See 'systemctl status vsftpd.service' and 'journa                
lctl -xn' for details.
[root@niche vsftpd]# systemctl status vsftpd.service
vsftpd.service - Vsftpd ftp daemon
   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled)
   Active: failed (Result: exit-code) since Tue 2014-12-16 16:32:09 UTC; 15s ago
  Process: 13586 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited                
, status=1/FAILURE)

Dec 16 16:32:09 niche systemd[1]: vsftpd.service: control process exited, c...=1
Dec 16 16:32:09 niche systemd[1]: Failed to start Vsftpd ftp daemon.
Dec 16 16:32:09 niche systemd[1]: Unit vsftpd.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
[root@niche vsftpd]# systemctl start vsftpd
Job for vsftpd.service failed. See 'systemctl status vsftpd.service' and 'journalctl -xn' for de
[root@niche vsftpd]# journalctl -xn
-- Logs begin at Tue 2014-12-16 06:28:59 UTC, end at Tue 2014-12-16 16:33:26 UTC. --
Dec 16 16:31:49 niche 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.
Dec 16 16:31:49 niche systemd[1]: Unit vsftpd.service entered failed state.
Dec 16 16:32:06 niche systemd[1]: Starting Vsftpd ftp daemon...
-- Subject: Unit vsftpd.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit vsftpd.service has begun starting up.
Dec 16 16:32:09 niche systemd[1]: vsftpd.service: control process exited, code=exited status=1
Dec 16 16:32:09 niche 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.
Dec 16 16:32:09 niche systemd[1]: Unit vsftpd.service entered failed state.
Dec 16 16:33:23 niche systemd[1]: Starting Vsftpd ftp daemon...
-- Subject: Unit vsftpd.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit vsftpd.service has begun starting up.
Dec 16 16:33:26 niche systemd[1]: vsftpd.service: control process exited, code=e
Dec 16 16:33:26 niche 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.
Dec 16 16:33:26 niche systemd[1]: Unit vsftpd.service entered failed state.
lines 6-42/42 (END)
--
-- Unit vsftpd.service has failed.
--
-- The result is failed.
Dec 16 16:31:49 niche systemd[1]: Unit vsftpd.service entered failed state.
Dec 16 16:32:06 niche systemd[1]: Starting Vsftpd ftp daemon...
-- Subject: Unit vsftpd.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit vsftpd.service has begun starting up.
Dec 16 16:32:09 niche systemd[1]: vsftpd.service: control process exited, code=e
Dec 16 16:32:09 niche systemd[1]: Failed to start Vsftpd ftp daemon.
[root@niche vsftpd]#


如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

卖梦商人 2022-09-06 16:26:24

出现错误的原因是:由于centos7中vsftp的配置文件默认将 listen_ipv6=YES 这一行没有注释掉,而我们目前的网络环境还不支持ipv6,从而导致出现错误无法启动,所以解决方法是将 listen_ipv6=YES更改为:listen_ipv6=NO,或将这一行注释掉

按上面的方法注释掉 listen_ipv6=YES后,成功启动vsftp

樱花细雨 2022-09-06 16:26:24

直接用/etc/init.d/vsftpd启动
配置如下:


anon_world_readable_only=NO
anonymous_enable=NO
chroot_local_user=YES
guest_enable=NO
guest_username=ftp
hide_ids=YES
listen=YES
listen_address=192.168.1.200
local_enable=YES
max_clients=500
max_per_ip=200
nopriv_user=ftp
pam_service_name=ftp
pasv_max_port=65535
pasv_min_port=64000
session_support=NO
use_localtime=YES
user_config_dir=/etc/vsftpd/users
userlist_enable=YES
userlist_file=/etc/vsftpd/denied_users
xferlog_enable=YES
anon_umask=0007
local_umask=0022
async_abor_enable=YES
connect_from_port_20=YES
dirlist_enable=NO
download_enable=NO
reverse_lookup_enable=NO
dual_log_enable=YES
vsftpd_log_file=/var/log/vsftpd.log

情绪少女 2022-09-06 16:26:24

有时可能是selinux影响,不允许访问sslkey文件,执行如下命令放开限制

setsebool -P ftp_home_dir=1   //设置ftp可以使用home目录
setsebool -P allow_ftpd_full_access=1   //设置ftp用户可以有所有权限
樱花落人离去 2022-09-06 16:26:24

最好能把配置文件给出来看看

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文