阿里轻量应用服务器搭建ftp服务器

一、修改默认的防火墙firewaliptables

我在搭建ftp服务器的过程中,总是不成功,然后把防火墙换了以后,就莫名其妙的可以了,所以这里需要把防火墙换一下。
1、关闭原来的防火墙

systemctl stop firewalld.service #停止firewall

systemctl disable firewalld.service #禁止firewall开机启动

2、安装iptables

yum -y install iptables-services

3、将iptables设置为开机启动

systemctl enable iptables.service #设置防火墙开机启动

4、我们既然要使用iptables,我们就需要配置防火墙可以通行的端口,一下是放行端口的方法:
首先打开配置文件:vim /etc/sysconfig/iptables
这里写图片描述
然后添加通行端口,例如:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

最后重新启动防火墙,使配置生效

systemctl restart iptables.service #重启防火墙使配置生效
二、安装vsftpd和修改相关的配置文件

1、通过yum安装vsftpd

yum install -y vsftpd

2、修改vsftpd的配置文件

vim /etc/vsftpd/vsftpd.conf

关于如何配置,这里只是关于我的配置,应该按照自己的要求自行修改:

# 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.
# Wh
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值