Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To make passive FTP work on Ubuntu, configure the FTP server with a fixed passive-port range, permit TCP 21 and that entire range through every firewall and NAT device, and allow established or related connections. In vsftpd, set pasv_min_port and pasv_max_port, then create matching firewall rules. If the server is behind NAT, advertise the reachable public address with pasv_address and forward the same ports to the server.

Opening ports fixes reachability only. Traditional FTP sends credentials and file data without encryption, so use FTPS or SFTP when confidentiality matters.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How passive FTP connections work

FTP uses two TCP connections. The client first opens a control connection to the server on TCP port 21. After authentication, a passive-mode command tells the server to listen on a separate, server-selected TCP port for the data connection used by directory listings, uploads, and downloads.

That second connection is why a login can succeed while LIST, uploads, or downloads hang. Port 21 may be reachable while the negotiated data port is blocked by the Ubuntu host firewall, a cloud security group, a perimeter firewall, or a NAT device.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

The packet path you must permit

  1. The client connects to the server’s address on TCP 21.
  2. The server replies to the passive-mode request with an address and a port.
  3. The client opens a new TCP connection to that advertised address and port.
  4. The server and client exchange directory or file data on that connection.

Every layer in that path must agree: the daemon’s configured range, the iptables rules, any upstream firewall rules, and any NAT forwarding. A mismatch at one layer produces the familiar symptom of successful login followed by a stalled listing or transfer.

Choose and bound the passive-port range

By default, the documented vsftpd values for pasv_min_port and pasv_max_port are 0. That leaves the daemon free to use any port, which is difficult to express safely in a firewall policy. A bounded range makes the required exposure explicit and easier to forward through NAT.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Example vsftpd settings

pasv_enable=YES
pasv_min_port=30000
pasv_max_port=31000
# Set only when NAT or another advertised address requires it:
# pasv_address=203.0.113.10

The numbers above are an example, not an Ubuntu or vsftpd default. Select a range that fits expected simultaneous transfers and your security policy. A narrower range exposes fewer ports but can limit concurrency; a broader range supports more simultaneous data sessions while increasing the number of reachable ports.

How to decide the size

  • Estimate the maximum number of simultaneous data connections, including listings and transfers.
  • Leave headroom for bursts rather than choosing a range that is barely large enough.
  • Document the range so firewall, NAT, cloud-security-group, and monitoring changes stay synchronized.
  • Do not publish a broad range merely because it is convenient; every allowed port is an additional service entry point.

Edit the active vsftpd configuration, save it, and restart or reload the service according to how that host is administered. Confirm the daemon actually loaded the values before testing the firewall.

Inspect Ubuntu’s firewall ownership before changing rules

Ubuntu can expose an iptables command interface backed by either the legacy implementation or the nftables API. Ubuntu states that the iptables package has provided nftables-compatible tools since 16.04, and that the nftables backend became the default in 20.10. The command syntax can look the same while the underlying ruleset is different.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Check which iptables alternative is active

update-alternatives --display iptables

Also inspect the live rules and identify whether UFW, direct iptables commands, or native nftables is the system’s authoritative manager. Do not add rules to one manager while another manager rewrites the same Netfilter hooks. Ubuntu documents that nftables and iptables share Netfilter hooks and that competing rule managers can overwrite one another.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Record the current policy and rule order

Before appending anything, determine the default INPUT policy, existing accept rules, and whether an earlier reject or drop rule will be reached first. Rule order matters: an allow rule appended after a terminating drop will never match. Make a rollback record of the current rules using the administration method already used on the host.

Add the IPv4 iptables rules

For a host whose policy uses an INPUT chain, this is the representative IPv4 pattern:

sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 21 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 30000:31000 -j ACCEPT

The passive range in the final rule must exactly match pasv_min_port through pasv_max_port. The first rule permits return traffic for connections already tracked as established or related. Place equivalent rules in the chain and position required by the host’s existing policy; blindly appending duplicates is not a safe deployment method.

Restrict sources when possible

If only known networks or client addresses use the service, constrain the port-21 and passive-range rules to those sources using the policy conventions already present on the server. If the service must be reachable from arbitrary Internet clients, maintain monitoring and account controls because the passive range is intentionally exposed to those clients.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

IPv6 is a separate decision

The commands above affect IPv4. If clients connect over IPv6, inspect and configure the host’s IPv6 firewall policy separately with the firewall manager that owns it. Do not assume an IPv4 rule automatically protects or permits IPv6 traffic.

Handle NAT, routers, and cloud firewalls

A server behind NAT has two addresses relevant to passive FTP: the private address where vsftpd listens and the public address that the client can reach. The server’s PASV response must contain a reachable address and port.

Forward both control and data ports

  1. Forward TCP 21 on the public interface to TCP 21 on the FTP host.
  2. Forward every TCP port in the configured passive range to the same range on that host.
  3. Allow TCP 21 and the complete passive range in any perimeter firewall, cloud security group, or load-balancing policy.
  4. Set pasv_address to the reachable public address when the daemon would otherwise advertise an unsuitable local address.

Use pasv_address only when an address override is required, such as a NAT deployment or another non-default advertised address. If the advertised address is wrong, the control connection can still authenticate while the client’s data connection goes to an unroutable or private address.

Keep forwarding and daemon settings synchronized

Changing the range in vsftpd without changing the NAT rule leaves some or all data ports unreachable. Conversely, forwarding a range that the daemon never uses increases exposure without improving operation. Treat the daemon range, host firewall range, and edge forwarding range as one configuration item.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand conntrack and FTP helpers

Linux connection tracking records state so a firewall can classify packets as ESTABLISHED or RELATED. That stateful layer is distinct from simply allowing TCP 21. A passive data connection may be accepted because it is explicitly allowed by the range rule, because it is classified as related, or both, depending on the ruleset.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Some deployments also use an FTP conntrack helper to associate FTP control activity with data flows. Helper assignment differs across kernel versions and nftables configurations, and encrypted FTPS can prevent inspection of the control channel. There is no single helper command that is correct for every Ubuntu release.

Verify instead of assuming helper behavior

  • Inspect the active firewall and conntrack configuration for the running release.
  • Use a packet capture or conntrack inspection while making a test listing or transfer.
  • Determine whether the data flow is accepted as RELATED, accepted by the explicit passive-range rule, or dropped before tracking.
  • Do not infer that a helper is active merely because port 21 is open.

If you change helper assignment, test both plain FTP and the encrypted mode you intend to support. Keep the explicit passive-range rule when your policy requires direct port authorization; helper behavior should not be your only reachability plan.

Persist rules with one administration system

Rules entered with iptables are not automatically a durable configuration on every Ubuntu installation. Persist them through the firewall manager that owns the host, and verify after a reboot or ruleset reload that the three required elements remain present: the established/related rule, TCP 21, and the complete passive range.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not combine independently managed UFW, direct iptables, and native nftables configurations unless you have deliberately designed their interaction. Ubuntu warns that multiple managers can replace one another’s rules. A consistent owner makes startup order, auditing, and rollback predictable.

Test from the same network your users will use

  1. Restart or reload vsftpd after editing its configuration.
  2. Confirm the daemon is listening for the control service on the expected interface and TCP 21.
  3. Connect with an FTP client and authenticate.
  4. Request a directory listing in passive mode, then test a download and an upload.
  5. Observe the PASV response and record the advertised address and port.
  6. Check the Ubuntu firewall, any upstream firewall, and NAT logs for that exact port.
  7. Repeat from an external network when NAT or a cloud perimeter is involved; an internal test can succeed through hairpin or split-horizon behavior while external clients fail.

A successful login proves only that the control path works. A successful listing and file transfer prove that the negotiated data path also works.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot a login that works but listings hang

The advertised port is outside the allowed range

Read the PASV reply and compare its port with pasv_min_port and pasv_max_port. If the daemon is still choosing arbitrary ports, the configuration may not have loaded, the wrong configuration file may be active, or the service may not have been restarted or reloaded.

The host firewall allows 21 but not the data range

Inspect the live INPUT rules and their order. Confirm that the range rule covers every port, not only the first or last value, and that an earlier drop does not prevent it from matching.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An edge firewall or security group blocks the range

Check each network boundary independently. A host capture showing no incoming SYN for the negotiated data port points toward NAT, routing, or an upstream policy rather than the FTP daemon.

NAT advertises an unreachable address

Compare the address in the PASV response with the address the client can route to. If it is private or belongs to the wrong interface, configure pasv_address with the public, reachable address and forward the passive range to the host.

State tracking does not classify the flow as expected

Use packet capture or conntrack inspection during a transfer. If the packet arrives but is neither accepted by the explicit range rule nor recognized as related, review conntrack and helper behavior for the active Ubuntu kernel and nftables configuration. Avoid copying a helper recipe intended for another release.

Only encrypted FTP fails

FTPS encrypts the control channel, so a helper that depends on reading FTP commands may not identify related data ports. Keep a bounded, explicitly permitted passive range and verify the FTPS server’s address and NAT settings. If you do not need FTP compatibility, SFTP avoids FTP’s separate data-channel design by using SSH instead.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Security and protocol choices

Canonical’s Ubuntu Server documentation describes FTP as a TCP protocol for downloading files between computers and warns that FTP credentials and data are sent in clear text. Passive-port rules solve firewall traversal; they do not add confidentiality, integrity, or protection against credential capture.

Choice Firewall and network implication Security property
Plain FTP TCP 21 plus the passive range; NAT must advertise and forward both. Credentials and data are clear text.
FTPS Uses FTP’s control/data model, so the passive range and NAT considerations remain. Adds TLS, but helper inspection can be affected by encryption.
SFTP Uses SSH rather than FTP’s separate passive data ports. Uses SSH encryption; configure the SSH service and its firewall policy instead.

Choose the protocol based on client compatibility and security requirements. Do not describe an opened passive range as a security control.

Trade-offs at a glance

Design decision Advantages Costs and risks
Narrow passive range Smaller firewall and NAT exposure; easier auditing. Can run out of ports under concurrent transfers.
Broad passive range More capacity for simultaneous data sessions. More exposed ports and a larger forwarding policy.
Direct public hosting No separate address-translation layer; simpler PASV addressing. The host is directly exposed and still needs perimeter controls.
Hosting behind NAT Keeps the server on a private network. Requires TCP 21 forwarding, full-range forwarding, and correct advertised address.
Direct iptables commands Immediate and precise rule changes. Can conflict with UFW or native nftables and may not persist automatically.
One managed firewall owner Consistent ordering, persistence, and rollback. Requires learning that manager’s syntax and lifecycle.

Operational checklist

  • Daemon: pasv_enable=YES is set, the minimum and maximum ports form the intended bounded range, and the service has been reloaded.
  • Host firewall: TCP 21 and every passive-range port are allowed in the correct chain and before any terminating drop.
  • State: An ESTABLISHED,RELATED rule is present where the policy requires it, and conntrack behavior has been observed rather than assumed.
  • NAT: TCP 21 and the entire range are forwarded to the FTP host, with pasv_address set when the public address must be advertised.
  • Ownership: UFW, direct iptables, or native nftables is identified as the authoritative manager; competing managers are not overwriting rules.
  • Testing: External passive listing, upload, and download tests succeed, not just authentication.
  • Security: Plain FTP is avoided when clear-text credentials or data are unacceptable; FTPS or SFTP is selected deliberately.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.