Linux vsftp 安装与配置

版权声明:本文为博主原创文章,网络媒体转载请注明出处,否则属于侵权行为 https://blog.csdn.net/github_38336924/article/details/82492992

Linux vsftp 安装与配置

1、安装

  • 更新安装源
# Ubuntu
apt-get update

# CentOS
yum update
  • 安装
# Ubuntu
apt-get install vsftpd

# CentOS
yum install vsftpd

2、配置

  • 使用命令 vi /etc/vsftpd.conf 打开文件去掉如下代码注释
# 是否允许匿名ftp,若不允许选NO
anonymous_enable=NO

# 是否允许本地用户登录
local_enable=YES

# 是否允许本地用户写的权限
write_enable=YES

# 是否将所有用户限制在主目录
chroot_local_user=YES

# 是否启动限制用户的名单
chroot_list_enable=YES

# 可在文件中设置多个账号
chroot_list_file=/etc/vsftpd.chroot_list

3、错误码 及 解决办法

3.1、 530 login incorrect

/etc/ftpusers使用#注释掉root

#root
3.2、500 OPPS:could not read chroot() list file : /etc/vsftpd.chroot_list

etc文件夹中创建一个名为vsftpd.chroot_list的文件(只需创建,不需要写内容)

touch /etc/vsftpd.chroot_list
3.3、 500 OPPS:vsftpd : refusing to run with writable root inside chroot()

/etc/vsftpd.conf文件中结尾加入如下代码

allow_writeable_chroot=YES
3.4、530 Login incorrect

如果是Ubuntu用户,登录时还提示如上错误码,请执行如下命令解决

# 暴力方式
rm -rf /etc/pam.d/vsftpd

# 担心以后会用到这个文件
mv /etc/pam.d/vsftpd /root

猜你喜欢

转载自blog.csdn.net/github_38336924/article/details/82492992
今日推荐