java多线程    Java入门    vsftp    ftp    linux配置    centos    FRP教程    HBase    Html5缓存    webp    zabbix    分布式    neo4j图数据库    

centos下配置vsftp各种问题解决

本篇文章并没有介绍具体的FTP如何配置,而是随手笔记,记录你也可能遇到的奇葩问题。
越学越发现我的无知,说多了都是泪。

别忘记开iptables
/sbin/iptables -I INPUT -p tcp --dport 21 -j ACCEPT

限制在自己的目录
chroot_local_user=NO (经过无数测试,必须是NO才是限制在自己的目录,不是其他帖子里写的YES)
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list

将自己的账户放在chroot_list里,一行一个。

useradd -d /lenovo/mobile/x -g ftp -s /sbin/nologin testftp

/sbin/service vsftpd restart

/etc/vsftpd/vsftpd.conf

解决连接FTP速度慢的方法
与ssh一样,vsftp的配置文件默认开启了DNS反向解析,这可能会造成用户在登陆到FTP服务器的时候奇慢无比,只要在配置文件中禁用DNS反向解析即可解决文件。
编辑/etc/vsftpd/vsftpd.conf
添加

reverse_lookup_enable=NO

重启vsftpd服务后问题解决,现在登陆看看,是不是秒进了~

解决不开更多的端口,就无法进行被动连接的方案

通过配置iptables只开放21端口即可实现客户端的主动连接和被动连接。

# 配置最基本的iptables规则
iptables -F
iptables -X
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -m state --state NEW -p tcp --dport 22 -j ACCEPT
iptables -P INPUT DROP
iptables -P FORWARD DROP

/sbin/iptables -I INPUT -p tcp --dport 21 -j ACCEPT

# 保存iptables规则
service iptables save

# 修改/etc/sysconfig/iptables-config文件
将IPTABLES_MODULES=""改成IPTABLES_MODULES="ip_nat_ftp"

# 重启iptables
service iptables restart


This entry was posted in Linux and tagged . Bookmark the permalink.
月小升QQ 2651044202, 技术交流QQ群 178491360
首发地址:月小升博客https://java-er.com/blog/centos-vsftp-connect/
无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢
您的评论是我写作的动力.

9 Responses to centos下配置vsftp各种问题解决

  1. cping says:

    踩一下,盼望回访,xrpmoon.com/blog

  2. Gabriela Larios says:

    To the java-er.com Administrator!

    Unleash the Power of BOGO PROMO – Buy One, Get One Free!

    Claim your 50% Discount Coupon Code: “NWQM28XA” and skyrocket your SEO game!

    Explore the world of SEO Services at https://cutt.ly/Fwu214Z0 and follow these steps:

    1️⃣ Fill your shopping cart with an abundance of services.
    2️⃣ Apply the coupon code during checkout.
    3️⃣ Pay only half of what you’ve added to your cart!

    Here’s an EXAMPLE:
    Add $200 worth of products, and pay a mere $100.
    Add $500 worth of products, and pay just $250.
    Add $2000 worth of products, and pay a mere $1000.

    ✅ TERMS & CONDITIONS:
    This coupon cannot be combined with other coupons.
    The discount applies to all products site-wide.
    Remember, you can use the coupon code only once.

    ⌛️ The clock is ticking! Seize this opportunity before the promotion expires. Act now and transform your SEO strategy! ⌛️

    Thanks,
    Gabriela

    Belgium, WHT, Ostiches, 7804, Rue Du Bienne 454
    If you prefer not to receive these offers any longer, kindly reply to this email.

  3. Kia Baeza says:

    Hi java-er.com Admin!

    Ready to earn effortlessly?

    Introducing the World’s Fastest & Easiest Breakthrough for Automated $300+ Commissions from Free Traffic!

    CLICK HERE https://cutt.ly/2wgZIVXe TO CONTINUE

    It’s beginner-friendly, requiring just 3 simple steps. No experience needed!

    Imagine making $300+ with just a few clicks. It’s within reach.

    Your journey to financial freedom starts with a simple click. Don’t miss out!

    In appreciation
    Kia

    Germany, RP, Nieder-Wiesen, 55234, Motzstr. 97
    If you want to stop receiving these specific types of offers, please reply to this email.

  4. Rhonda Haley says:

    To the java-er.com Webmaster.

    Ready to earn effortlessly?

    Introducing the World’s Fastest & Easiest Breakthrough for Automated $300+ Commissions from Free Traffic!

    CLICK HERE https://cutt.ly/2wgZIVXe TO CONTINUE

    It’s beginner-friendly, requiring just 3 simple steps. No experience needed!

    Imagine making $300+ with just a few clicks. It’s within reach.

    Your journey to financial freedom starts with a simple click. Don’t miss out!

    Yours cordially
    Rhonda

    United Kingdom, NA, Coynach, Ab34 0dl, 51 Freezeland Lane
    If you want to stop getting these types of offers, please reply to this email.

  5. Floyd Bauer says:

    Hi java-er.com Admin!

    Ready to earn effortlessly?

    Introducing the World’s Fastest & Easiest Breakthrough for Automated $300+ Commissions from Free Traffic!

    CLICK HERE https://cutt.ly/ewc5HKbu

    It’s beginner-friendly, requiring just 3 simple steps. No experience needed!

    Imagine making $300+ with just a few clicks. It’s within reach.

    Your journey to financial freedom starts with a simple click. Don’t miss out!

    Take care
    Floyd

    Australia, QLD, Doctor Creek, 4352, 75 Goldfields Road
    To exclude yourself from receiving these particular offers, please reply to this email.

  6. Abe Alngindabu says:

    Hello java-er.com Admin.

    Ready to earn effortlessly?

    Introducing the World’s Fastest & Easiest Breakthrough for Automated $300+ Commissions from Free Traffic!

    CLICK HERE https://cutt.ly/ewc5HKbu

    It’s beginner-friendly, requiring just 3 simple steps. No experience needed!

    Imagine making $300+ with just a few clicks. It’s within reach.

    Your journey to financial freedom starts with a simple click. Don’t miss out!

    Wishing you wellness
    Abe

    France, ILE-DE-FRANCE, Pontault-Combault, 77340, 84 Rue De La Boetie
    To remove yourself from this offer mailing, simply respond to this email.

  7. Dewayne Willard says:

    Hello java-er.com Administrator!

    Ready to earn effortlessly?

    Introducing the World’s Fastest & Easiest Breakthrough for Automated $300+ Commissions from Free Traffic!

    CLICK HERE https://cutt.ly/dwn4hzkF

    It’s beginner-friendly, requiring just 3 simple steps. No experience needed!

    Imagine making $300+ with just a few clicks. It’s within reach.

    Your journey to financial freedom starts with a simple click. Don’t miss out!

    Sending love
    Dewayne

    Netherlands, LI, Maastricht, 6213 Hv, Heukelommerweg 162
    To end the receipt of these specific offers, kindly reply to this email.

  8. Fred Bull says:

    Dear java-er.com Admin.

    The World’s Fastest & Easiest Breakthrough For Automated $300+ Commissions From Free Traffic
    Anyone Can Do This, 100% Beginners Friendly

    SEE HERE https://cutt.ly/swI9PMyz

    Wishing you prosperity
    Fred

    Austria, BURGENLAND, Plone, 9782, Steinamangerer Strasse 73
    To cease receiving these specific offers, please reply to this email.

  9. Sarah Courts says:

    Hey there,

    Tired of relentless itching keeping you up? Discover Debriding Soap – your ultimate relief from itching and crawling sensations caused by skin parasites. It’s time to reclaim your sleep and peace of mind.

    Here’s why you should try Debriding Soap:

    Immediate Relief: Experience instant soothing from severe itching and crawling sensations.

    Sleep Through the Night: Finally, get the sleep you deserve without being constantly disturbed.

    Nourish Your Skin: Our non-toxic formula not only stops the itch but also nourishes your skin.

    And the best part? Act now and get Debriding Soap at a whopping 50% off the regular price. Don’t miss out on this limited-time Black Friday and Holiday sale offer!

    Ready to end the itch today? Click the link below to view the special offer:

    Click here: –> https://bit.ly/debridingsoap

    Still skeptical? We offer a 30-day money-back guarantee. Try Debriding Soap risk-free, and if you’re not completely satisfied, simply return it – no questions asked.

    Sleep better tonight and bid farewell to itching with Debriding Soap.

    Best regards,

    Sarah
    GYLB

    P.S. Don’t miss your chance to claim your discount and experience relief. Click the link above to visit our website now.

Leave a Reply