当前位置:网站首页>在iptables防火墙下开启vsftpd的端口
在iptables防火墙下开启vsftpd的端口
2022-07-03 16:58:00 【星哥玩云】
在开启vsftpd端口后发现用客户端工具能登陆,但无法浏览文件和新建文件.此时看了一下ftp的协议,发现ftp有主动模式和被动模式.在服务端开21端口是让客户端进来,并没有出去的端口,还在服务端开启出去的端口,最后还要添加ftp相应的模块,整个操作有点复杂,今天写下来对自己以后加深印像。
1.安装vsftpd软件
yum install vsftpd -y
2.开启匿名访问和被动模式端口
vim /etc/vsftpd/vsftpd.conf
anonymous_enable=YES --开启匿名用户访问
anon_upload_enable=YES --匿名用户名可以上传文件
anon_mkdir_write_enable=YES --匿名用户可以创建文件 anon_other_write_enable=YES --匿名用户可以重命名文件
pasv_enable=YES --开启被动模式 pasv_min_port=30000 --被动模式最小端口 pasv_max_port=31000 --被动模式最大端口
3.加载ftp模块
vim /etc/modprobe.d/vsftpd.conf
alias ip_conntrack ip_conntrack_ftp ip_nat_ftp --加载ftp模块
vim /etc/rc.local
/sbin/modprobe ip_conntract --开机加载模块 /sbin/modprobe ip_conntrack_ftp /sbin/modprobe ip_nat_ftp
4.端口过滤
vim /etc/sysconfig/iptables
-A INPUT -p tcp -m multiport --dport 20,21 -m state --state NEW -j ACCEPT --开启20,21端口 -A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT --开启21主动端口 -A INPUT -p tcp --dport 30000:31000 -j ACCEPT --开启被动端口
5.登陆测试
边栏推荐
- There are several APIs of airtest and poco that are easy to use wrong in "super". See if you have encountered them
- Prepare for the golden three silver four, 100+ software test interview questions (function / interface / Automation) interview questions. win victory the moment one raises one 's standard
- 線程池:業務代碼最常用也最容易犯錯的組件
- 汇编实例解析--实模式下屏幕显示
- Execute script unrecognized \r
- Network security web penetration technology
- [JDBC] API parsing
- 数据分析必备的能力
- 建立自己的网站(23)
- QT serial port UI design and solution to display Chinese garbled code
猜你喜欢

UCORE overview

Unreal_ Datatable implements ID self increment and sets rowname

CC2530 common registers for serial communication

Le zèbre a été identifié comme un chien, et la cause de l'erreur d'AI a été trouvée par Stanford

(Supplement) double pointer topic

静态程序分析(一)—— 大纲思维导图与内容介绍

What material is sa537cl2? Analysis of mechanical properties of American standard container plate

QT serial port UI design and solution to display Chinese garbled code

跨境电商:外贸企业做海外社媒营销的优势

word 退格键删除不了选中文本,只能按delete
随机推荐
Aike AI frontier promotion (7.3)
word 退格键删除不了选中文本,只能按delete
【剑指 Offer】58 - II. 左旋转字符串
MySQL single table field duplicate data takes the latest SQL statement
【Try to Hack】主动侦查隐藏技术
Necessary ability of data analysis
Prepare for the golden three silver four, 100+ software test interview questions (function / interface / Automation) interview questions. win victory the moment one raises one 's standard
CC2530 common registers for port interrupts
Résolution de l'instance d'assemblage - - affichage à l'écran en mode réel
Zebras are recognized as dogs, and Stanford found the reason why AI made mistakes
visual studio “通常每个套接字地址(协议/网络地址/端口)只允许使用一次“
[2. Basics of Delphi grammar] 2 Object Pascal data type
手把手带你入门 API 开发
CC2530 common registers for port initialization
Central South University | through exploration and understanding: find interpretable features with deep reinforcement learning
美团一面:为什么线程崩溃崩溃不会导致 JVM 崩溃
What is your income level in the country?
[combinatorial mathematics] counting model, common combinatorial numbers and combinatorial identities**
Redis:关于列表List类型数据的操作命令
爱可可AI前沿推介(7.3)