当前位置:网站首页>在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.登陆测试
边栏推荐
- What is the material of 13mnnimor? 13mnnimor steel plate for medium and low temperature pressure vessels
- Informatics Olympiad all in one YBT 1175: divide by 13 | openjudge noi 1.13 27: divide by 13
- Aike AI frontier promotion (7.3)
- visual studio “通常每个套接字地址(协议/网络地址/端口)只允许使用一次“
- Kotlin learning quick start (7) -- wonderful use of expansion
- 汇编实例解析--实模式下屏幕显示
- 聊聊接口优化的几个方法
- NLP四范式:范式一:非神经网络时代的完全监督学习(特征工程);范式二:基于神经网络的完全监督学习(架构工程);范式三:预训练,精调范式(目标工程);范式四:预训练,提示,预测范式(Prompt工程)
- C语言按行修改文件
- 29: Chapter 3: develop Passport Service: 12: develop [obtain user account information, interface]; (use VO class to package the found data to meet the requirements of the interface for the returned da
猜你喜欢

IDEA-配置插件

What is the pledge pool and how to pledge?

网络安全web渗透技术

線程池:業務代碼最常用也最容易犯錯的組件

Bcvp developer community 2022 exclusive peripheral first bullet

Kotlin learning quick start (7) -- wonderful use of expansion

CC2530 common registers for port interrupts

13mnnimo5-4 German standard steel plate 13MnNiMo54 boiler steel 13MnNiMo54 chemical properties

Yu Wenwen, Hu Xia and other stars take you to play with the party. Pipi app ignites your summer

What is the difference between 14Cr1MoR container plate and 14Cr1MoR (H)? Chemical composition and performance analysis of 14Cr1MoR
随机推荐
CC2530 common registers for watchdog
How to allow remote connection to MySQL server on Linux system?
深入理解 SQL 中的 Grouping Sets 语句
数据分析必备的能力
utfwry. Dat PHP, about ThinkPHP's method of IP location using utfwry address Library
【Try to Hack】主动侦查隐藏技术
BYD and great wall hybrid market "get together" again
[combinatorics] recursive equation (example 1 of recursive equation | list recursive equation)
[combinatorics] recursive equation (outline of recursive equation content | definition of recursive equation | example description of recursive equation | Fibonacci Series)
Build your own website (23)
PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
Preventing/catching “IllegalArgumentException: parameter must be a descendant of this view” error
美团一面:为什么线程崩溃崩溃不会导致 JVM 崩溃
On Lagrange interpolation and its application
什么是质押池,如何进行质押呢?
PHP online confusion encryption tutorial sharing + basically no solution
Hong Kong Polytechnic University | data efficient reinforcement learning and adaptive optimal perimeter control of network traffic dynamics
What is the pledge pool and how to pledge?
Take you to API development by hand
Bcvp developer community 2022 exclusive peripheral first bullet