CentOS 7 VSFTPD 安装与配置(虚拟用户)

一、LINUX最小安装

Linux 版本

二、禁用防火墙

禁用firewall也可以,更彻底:

systemctl disable firewalld

@其他关于防火墙的命令

启动: systemctl start firewalld

关闭: systemctl stop firewalld

查看状态: systemctl status firewalld

开机禁用 : systemctl disable firewalld

开机启用 : systemctl enable firewalld

三、关闭selinux

关闭selinux,不关闭ftp工具应该可以连接,但是传输文件的时候,会发现文件上传和下载都会出现500、503 、200等报错

通过配置文件修改禁用

#打开SELINUX配置文件

vi /etc/selinux/config

#修改配置参数

#注释

SELINUX=enforcing

#增加

SELINUX=disabled

四、安装VSFTPD

#安装

yum install -y vsftpd

#设置开机启动

systemctl enable vsftpd.service

#启动

service vsftpd start

#停止

service vsftpd stop

#查看状态

service vsftpd status

五、虚拟用户配置

首先需要我们新建一个虚拟宿主用户,也就是上边说的要映射的真实用户:

useradd virtualhost -s /sbin/nologin

这里设置宿主用户也不允许登录系统

修改配置文件如下(红色字体为修改处):

# Example config file /etc/vsftpd/vsftpd.conf

#

# The default compiled in settings are fairly paranoid. This sample file

# loosens things up a bit, to make the ftp daemon more usable.

# Please see vsftpd.conf.5 for all compiled in defaults.

#

# READ THIS: This example file is NOT an exhaustive list of vsftpd options.

# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's

# capabilities.

#

# Allow anonymous FTP? (Beware - allowed by default if you comment this out).

anonymous_enable=NO

#

# Uncomment this to allow local users to log in.

# When SELinux is enforcing check for SE bool ftp

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值