阿里云 Centos 7.2开启ftp服务用到端口

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wowocpp/article/details/85600432

记录1

https://www.jianshu.com/p/bf772ffc0c95
阿里云CentOS7搭建任何网络服务,需要配置相应的安全组规则。
开启阿里云端口权限
阿里云服务器端口权限是由安全组规则控制,所以配置FTP服务,需要打开服务器的20/21端口权限。
在这里插入图片描述
由于需要FTP支持被动模式(PASV),所以还需要开启有限范围的端口权限比如(40000-40080)。

在这里插入图片描述

vim /etc/vsftpd/vsftpd.conf

我的配置项如下:

anonymous_enable=NO     #不允许匿名访问
local_enable=YES        #允许使用本地帐户登录FTP
write_enable=YES
local_umask=022

dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES

ascii_upload_enable=YES
ascii_download_enable=YES

chroot_local_user=YES       #允许本地用户切换到FTP主目录以外的目录
chroot_list_enable=YES      #白名单模式开启,只有/etc/vsftpd/chroot_list指定的用户才可以切换到主目录
chroot_list_file=/etc/vsftpd/chroot_list    #本地用户切换目录白名单文件

listen=YES

listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

local_root=/home/www/apache/html    #FTP主目录

pasv_enable=YES         #开启PASV模式
pasv_min_port=40000     #PASV最小端口
pasv_max_port=40080     #PASV最大端口
pasv_promiscuous=YES

allow_writeable_chroot=YES      #允许写入目录(这项需要手动添加)




记录2

在这里插入图片描述
https://help.aliyun.com/document_detail/58746.html?spm=a2c4g.11186623.2.30.715c4c075RGNVw#ftp

记录3

FTP的搭建和使用
https://help.aliyun.com/knowledge_detail/60152.html

安全组规则的典型应用
https://help.aliyun.com/document_detail/58746.html?spm=a2c4g.11186623.2.30.4a954c07wcCQVF#ftp

猜你喜欢

转载自blog.csdn.net/wowocpp/article/details/85600432