当前位置:网站首页>在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.登陆测试
边栏推荐
- Talk about several methods of interface optimization
- 浅谈拉格朗日插值及其应用
- Leetcode: lucky number in matrix
- LeetCode 1657. Determine whether the two strings are close
- [Jianzhi offer] 58 - ii Rotate string left
- Thread pool executes scheduled tasks
- What material is 13crmo4-5 equivalent to in China? 13crmo4-5 chemical composition 13crmo4-5 mechanical properties
- Capacités nécessaires à l'analyse des données
- Kindeditor editor upload image ultra wide automatic compression -php code
- What kind of material is 14Cr1MoR? Analysis of chemical composition and mechanical properties of 14Cr1MoR
猜你喜欢

Unreal_ Datatable implements ID self increment and sets rowname

What is the pledge pool and how to pledge?

爱可可AI前沿推介(7.3)

ucore概述

Arduino esp32: overall framework of lvgl project (I)
![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](/img/1c/c655c8232de1c56203873dcf171f45.png)
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

Bcvp developer community 2022 exclusive peripheral first bullet

CC2530 common registers for crystal oscillator settings

Thread pool executes scheduled tasks

What kind of material is 14Cr1MoR? Analysis of chemical composition and mechanical properties of 14Cr1MoR
随机推荐
New features of C 10
mysql用户管理
线程池:业务代码最常用也最容易犯错的组件
【剑指 Offer 】64. 求1+2+…+n
Alibaba P8 painstakingly sorted it out. Summary of APP UI automated testing ideas. Check it out
Take you to API development by hand
Thread pool: the most common and error prone component of business code
How programming apes grow rapidly
function overloading
C语言按行修改文件
2022.02.14_ Daily question leetcode five hundred and forty
[Jianzhi offer] 58 - ii Rotate string left
CC2530 common registers for serial communication
[Jianzhi offer] 64 Find 1+2+... +n
13mnnimo5-4 German standard steel plate 13MnNiMo54 boiler steel 13MnNiMo54 chemical properties
CC2530 common registers for port interrupts
IL Runtime
[JDBC] API parsing
PHP online confusion encryption tutorial sharing + basically no solution
What material is sa537cl1? Sa537cl1 corresponds to the national standard material