当前位置:网站首页>在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.登陆测试
边栏推荐
- BYD and great wall hybrid market "get together" again
- Leetcode: lucky number in matrix
- 27. Input 3 integers and output them in descending order. Pointer method is required.
- Capacités nécessaires à l'analyse des données
- Processing strategy of message queue message loss and repeated message sending
- Define a structure fraction to represent a fraction, which is used to represent fractions such as 2/3 and 5/6
- [combinatorics] polynomial theorem (polynomial coefficients | full arrangement of multiple sets | number of schemes corresponding to the ball sub model | polynomial coefficient correlation identity)
- arduino-esp32:LVGL项目(一)整体框架
- LeetCode 1658. Minimum operand to reduce x to 0
- 建立自己的网站(23)
猜你喜欢

New features of C 10

C语言按行修改文件
![[try to hack] active detection and concealment technology](/img/43/d48f851268fec566ce0cc83bd9557e.png)
[try to hack] active detection and concealment technology

斑马识别成狗,AI犯错的原因被斯坦福找到了

图之深度优先搜索

Netease UI automation test exploration: airtest+poco

Shentong express expects an annual loss of nearly 1billion

手把手带你入门 API 开发

Bcvp developer community 2022 exclusive peripheral first bullet

斑馬識別成狗,AI犯錯的原因被斯坦福找到了
随机推荐
美团一面:为什么线程崩溃崩溃不会导致 JVM 崩溃
"The NTP socket is in use, exiting" appears when ntpdate synchronizes the time
NLP四范式:范式一:非神经网络时代的完全监督学习(特征工程);范式二:基于神经网络的完全监督学习(架构工程);范式三:预训练,精调范式(目标工程);范式四:预训练,提示,预测范式(Prompt工程)
[combinatorics] recursive equation (characteristic equation and characteristic root | example of characteristic equation | root formula of monadic quadratic equation)
Deep understanding of grouping sets statements in SQL
汇编实例解析--实模式下屏幕显示
C language modifies files by line
IDEA-配置插件
線程池:業務代碼最常用也最容易犯錯的組件
On Lagrange interpolation and its application
How to delete a specific line from a text file using the SED command?
UCORE overview
RF Analyze Demo搭建 Step by Step
(Supplement) double pointer topic
Execute script unrecognized \r
Add color to the interface automation test framework and realize the enterprise wechat test report
Define a structure fraction to represent a fraction, which is used to represent fractions such as 2/3 and 5/6
QT serial port UI design and solution to display Chinese garbled code
[combinatorics] polynomial theorem (polynomial coefficients | full arrangement of multiple sets | number of schemes corresponding to the ball sub model | polynomial coefficient correlation identity)
[combinatorial mathematics] recursive equation (example of recursive equation 2 Hanoi Tower | example of recursive equation 3 insertion sequencing)