当前位置:网站首页>在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.登陆测试
边栏推荐
- CC2530 common registers for watchdog
- 建立自己的网站(23)
- How to judge the region of an IP through C?
- BYD and great wall hybrid market "get together" again
- How to delete a specific line from a text file using the SED command?
- CC2530 common registers for crystal oscillator settings
- Idea configuration plug-in
- IDEA-配置插件
- CC2530 common registers for port interrupts
- C语言字符串练习
猜你喜欢

Kotlin学习快速入门(7)——扩展的妙用

ANOVA example
![[JDBC] API parsing](/img/75/0f69a4e246a571688355bb13e2cd73.jpg)
[JDBC] API parsing

IDEA-配置插件

The word backspace key cannot delete the selected text, so you can only press Delete

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

ucore概述

What is the material of 13mnnimor? 13mnnimor steel plate for medium and low temperature pressure vessels

线程池:业务代码最常用也最容易犯错的组件

网络安全web渗透技术
随机推荐
Résolution de l'instance d'assemblage - - affichage à l'écran en mode réel
[combinatorics] recursive equation (characteristic equation and characteristic root | example of characteristic equation | root formula of monadic quadratic equation)
Thread pool: the most common and error prone component of business code
What is your income level in the country?
What kind of material is 14Cr1MoR? Analysis of chemical composition and mechanical properties of 14Cr1MoR
浅谈拉格朗日插值及其应用
Yu Wenwen, Hu Xia and other stars take you to play with the party. Pipi app ignites your summer
[combinatorial mathematics] recursive equation (example of recursive equation 2 Hanoi Tower | example of recursive equation 3 insertion sequencing)
ANOVA example
静态程序分析(一)—— 大纲思维导图与内容介绍
function overloading
CC2530 common registers for crystal oscillator settings
What material is sa537cl2? Analysis of mechanical properties of American standard container plate
NLP四范式:范式一:非神经网络时代的完全监督学习(特征工程);范式二:基于神经网络的完全监督学习(架构工程);范式三:预训练,精调范式(目标工程);范式四:预训练,提示,预测范式(Prompt工程)
C语言按行修改文件
Talk about several methods of interface optimization
Summary of three methods of PHP looping through arrays list (), each (), and while
C language string practice
[combinatorics] non descending path problem (number of non descending paths with constraints)
mysql用户管理