当前位置:网站首页>在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.登陆测试
边栏推荐
- Bcvp developer community 2022 exclusive peripheral first bullet
- How programming apes grow rapidly
- Define a structure fraction to represent a fraction, which is used to represent fractions such as 2/3 and 5/6
- 【剑指 Offer】58 - I. 翻转单词顺序
- Deep understanding of grouping sets statements in SQL
- Pools de Threads: les composants les plus courants et les plus sujets aux erreurs du Code d'affaires
- There are several APIs of airtest and poco that are easy to use wrong in "super". See if you have encountered them
- Alibaba P8 painstakingly sorted it out. Summary of APP UI automated testing ideas. Check it out
- 建立自己的网站(23)
- Network security web penetration technology
猜你喜欢
13mnnimo5-4 German standard steel plate 13MnNiMo54 boiler steel 13MnNiMo54 chemical properties
線程池:業務代碼最常用也最容易犯錯的組件
Take you to API development by hand
线程池:业务代码最常用也最容易犯错的组件
Atom QT 16_ audiorecorder
跨境电商:外贸企业做海外社媒营销的优势
Talk about several methods of interface optimization
NLP四范式:范式一:非神经网络时代的完全监督学习(特征工程);范式二:基于神经网络的完全监督学习(架构工程);范式三:预训练,精调范式(目标工程);范式四:预训练,提示,预测范式(Prompt工程)
29:第三章:开发通行证服务:12:开发【获得用户账户信息,接口】;(使用VO类包装查到的数据,以符合接口对返回数据的要求)(在多处都会用到的逻辑,在Controller中可以把其抽成一个共用方法)
Bcvp developer community 2022 exclusive peripheral first bullet
随机推荐
浅谈拉格朗日插值及其应用
How to delete a specific line from a text file using the SED command?
Preventing/catching “IllegalArgumentException: parameter must be a descendant of this view” error
C language string practice
utfwry. Dat PHP, about ThinkPHP's method of IP location using utfwry address Library
The way of wisdom (unity of knowledge and action)
Hong Kong Polytechnic University | data efficient reinforcement learning and adaptive optimal perimeter control of network traffic dynamics
UCORE overview
Thread pool executes scheduled tasks
Visual studio "usually, each socket address (Protocol / network address / port) can only be used once“
香港理工大学|数据高效的强化学习和网络流量动态的自适应最优周界控制
CC2530 common registers for port interrupts
Kindeditor editor upload image ultra wide automatic compression -php code
[combinatorics] recursive equation (the relationship theorem between the solution of the recursive equation and the characteristic root | the linear property theorem of the solution of the recursive e
IDEA-配置插件
【剑指 Offer】58 - I. 翻转单词顺序
Capacités nécessaires à l'analyse des données
CC2530 common registers for serial communication
What is the difference between 14Cr1MoR container plate and 14Cr1MoR (H)? Chemical composition and performance analysis of 14Cr1MoR
[JDBC] API parsing