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

FTP uploads fail on a LEMP server when at least one access-control layer blocks the operation. Check them in order: vsftpd write policy, the Unix account and every directory in the path, chroot path mapping, and (on enforcing distributions) SELinux. Then design permissions so FTP, nginx, and PHP-FPM share only the directories that genuinely require shared write access.

The error may appear as “Permission denied” or 553 Could not create file. Changing modes blindly—especially to 777—often leaves the real identity or policy denial undiscovered and creates a larger security problem.

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.

What the error means

An FTP client asks vsftpd to perform a filesystem operation such as STOR (upload), MKD (create a directory), APPE, DELE, or rename. The request must pass several independent checks:

  1. vsftpd policy: the daemon must permit local or virtual users to issue write commands.
  2. Unix discretionary access control: the effective account needs traverse permission on every parent directory and write permission on the destination (directly or through a group).
  3. FTP path mapping: a chroot or local_root can make the path seen by FTP different from the path you test in a shell.
  4. SELinux mandatory access control: on enforcing systems, labels and booleans can deny access even when Unix ownership and modes look correct.

Diagnose the first failing layer instead of applying all possible fixes at once. The harmless touch test below separates Unix permission problems from FTP configuration and policy problems.

#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:Upgraded 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.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

1. Confirm vsftpd allows writes

In the Debian reference configuration, write_enable defaults to NO. The vsftpd project FAQ states: “By default, write commands, including uploads and new directories, are disabled.” The setting controls filesystem-changing commands including STOR, DELE, RNFR, RNTO, MKD, RMD, APPE, and SITE.

Inspect the effective settings

sudo grep -E '^(write_enable|local_enable|guest_enable|virtual_use_local_privs|chroot_local_user|local_root)' /etc/vsftpd.conf
  • write_enable=YES is required for uploads and other writes.
  • local_enable=YES is required for system (local) users to log in.
  • guest_enable=YES indicates guest/virtual-user operation; those users have a more restricted privilege model by default.
  • virtual_use_local_privs=YES gives virtual users the privileges of local users, subject to the filesystem and other vsftpd restrictions.

After changing the file, reload the daemon and reconnect the FTP client:

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

A reload applies configuration without a full stop/start. If the client still receives 553 after this change, continue with identity and path checks; write_enable does not grant Unix write permission by itself.

2. Identify the account and inspect the complete path

Do not assume the username shown by your FTP client is the process identity that reaches the filesystem. Determine the account and inspect each component of the destination path.

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 the account and directory components

id FTPUSER
namei -l /var/www/example/upload
ls -ld /var/www /var/www/example /var/www/example/upload

namei -l is important because a writable final directory is useless if the FTP account cannot traverse (x) one of its parents. For a directory, x means “search/traverse”; it is separate from listing (r) and creating entries (w).

  • Every parent directory from the filesystem root to the upload directory needs traverse permission for the account or one of its groups.
  • The destination directory needs write and traverse permission for that identity.
  • Check ownership, group membership, ACLs, and any mode bits that remove access for the relevant class.

Prove Unix access without FTP

Run a temporary-file test as the same account. Use a path that the account is expected to write, not the entire web root:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo -u FTPUSER touch /var/www/example/upload/.permission-test
sudo -u FTPUSER rm /var/www/example/upload/.permission-test

If touch fails, fix ownership, group membership, modes, or ACLs before changing vsftpd. If it succeeds, Unix DAC is probably not the failing layer; inspect chroot mapping, daemon logs, and SELinux.

3. Use a deployment group instead of world-writable web roots

FTP, nginx, and PHP-FPM commonly run as different identities. A dedicated group lets the required processes share selected directories without granting every local user write access.

Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【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.

Recommended directory boundaries

  • Releases: deployment-owned directories containing code and static assets. FTP (or a deployment job) writes new releases; nginx needs read and traverse access.
  • Runtime uploads: application data such as user-uploaded images. Grant write access only to the FTP account and the PHP-FPM pool when both must modify these files.
  • Caches: disposable data that should not be mixed with source code or uploads.

Keep the web root itself non-writable where possible. Make only the specific child directories writable, and verify the effective PHP-FPM user and group in the pool configuration before adding it to a shared group. Group changes require a new process or session to take effect, so reload PHP-FPM after changing pool membership.

Use set-group-ID directories (the directory mode includes 2 in the group-position, such as 2775) when you need newly created files and subdirectories to inherit the deployment group. Choose a restrictive umask so uploads do not become writable by unrelated users. Exact mode values must match your application’s needs; there is no safe universal mode for every LEMP layout.

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

Why chmod -R 777 is not a fix

Mode 777 gives every local account write access, can allow one compromised service to alter code, and does not bypass SELinux or a chroot path error. It also conceals which identity actually needs access. Restore least-privilege ownership and group permissions, then test as the real account.

4. Correct chroot and virtual-user path mapping

With chroot_local_user=YES, a local user is confined to a jail. A virtual user’s local_root can create a similar mapping. The path displayed in an FTP client is therefore relative to the jail, not necessarily the host’s absolute path.

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.

Build a writable child inside a protected jail

Keep the chroot root owned and protected so the account cannot alter the jail boundary. Create a child directory beneath it for uploads, and grant that child the required group or owner write permission. For example, an FTP path such as /upload may correspond to /srv/ftp/FTPUSER/upload on the host; test the host path with namei and sudo -u FTPUSER touch.

If an FTP client attempts to upload to the jail root and that root is intentionally non-writable, 553 is expected. Change the client’s remote directory to the writable child rather than making the jail root writable.

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

Do not enable unrestricted filesystem access merely to remove a path error. The vsftpd reference warns that options providing broad access can create serious security problems. A narrow local_root and a writable child directory are safer than disabling confinement.

5. Check SELinux when Unix permissions look correct

SELinux can deny FTP writes on an enforcing host even when ls -l and the touch test appear correct under a shell context. First determine enforcement and inspect the directory label:

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.
getenforce
ls -Zd /var/www/example/upload
sudo ausearch -m AVC -ts recent

An AVC record naming the FTP process and the target directory confirms a mandatory-policy denial. The relevant controls include the ftp_home_dir boolean for FTP access to home directories and allow_ftpd_anon_write for anonymous-write scenarios. Do not enable an anonymous-write boolean for a local-user upload problem unless your design actually uses anonymous FTP.

Use the right content type

SELinux distinguishes read-only public content (public_content_t) from writable public FTP content (public_content_rw_t). Label only the directory that must receive FTP uploads; leave application code and release directories read-only to the FTP service where possible.

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

For persistent labels, define a file-context rule with semanage fcontext and apply it with restorecon. A temporary chcon change can disappear after relabeling or policy maintenance, so it is not a durable production fix. After changing a boolean or context, repeat the harmless touch test and then retry the FTP upload.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

6. Let FTP and PHP-FPM share data safely

PHP-FPM pools run with configured user and group IDs, which may differ from the FTP account, nginx worker, and shell administrator. Verify the pool’s effective user and group settings and design the directory around those identities.

Shared-write pattern

  1. Create a dedicated application-data group.
  2. Add only the FTP account and the PHP-FPM pool account that must write runtime data.
  3. Assign the upload directory to that group and grant group write/traverse access.
  4. Keep release/code directories owned by the deployment identity and readable (not writable) by nginx and PHP-FPM unless the application genuinely modifies code.
  5. Reload PHP-FPM and start a new FTP session so group membership is recognized.
  6. Test both identities with harmless file creation and deletion before enabling production uploads.

Do not expose the PHP-FPM FastCGI listener to an untrusted network. PHP documentation warns that an exposed FastCGI connection can enable code execution. Bind it to an appropriate local socket or trusted private interface and restrict its permissions independently of the FTP directory.

7. A complete troubleshooting sequence

  1. Capture the exact failure: note the remote path, FTP command, username, timestamp, and whether login succeeds. A 553 on MKD is still a write-path problem, while a failure only after changing directories often indicates chroot mapping.
  2. Check daemon policy: verify write_enable, the appropriate local/guest settings, and reload vsftpd.
  3. Resolve the real identity: run id FTPUSER; for virtual users, determine the mapped local account and its privilege setting.
  4. Inspect every path component: run namei -l and ls -ld on the host path that should receive the file.
  5. Run the identity test: use sudo -u FTPUSER touch followed by removal. Fix Unix permissions if it fails.
  6. Verify chroot/local-root mapping: confirm that the client’s remote path points to the intended writable child, not the protected jail root.
  7. Check SELinux: on enforcing systems, inspect labels and recent AVC records, apply the narrow boolean/context correction, and retest.
  8. Read daemon logs: if all tests pass, correlate the upload timestamp with vsftpd and system logs for a per-user rule, filesystem-full condition, quota, or rename failure.

Common symptoms and targeted fixes

Symptom Most likely layer Action
Login succeeds but every upload and directory creation returns 553 vsftpd write policy Set write_enable=YES, confirm the user type, reload, and reconnect.
Only one directory fails; shell touch as the FTP account also fails Unix path permissions Use namei -l; correct parent traverse access and destination owner/group write access.
Shell test succeeds, but FTP cannot write to the displayed directory Chroot or local_root Map the FTP path to the host path and use a writable child inside the jail.
Unix checks pass on an enforcing distribution and AVC records appear SELinux Apply the narrow, persistent context or boolean required for that directory; avoid broad anonymous-write settings.
FTP succeeds but PHP uploads or image processing fail Different PHP-FPM identity or group Verify pool user/group and grant shared access only to the runtime-data directory.

Security checklist before calling the fix complete

  • FTP writes are enabled only for accounts that need them.
  • The FTP account is confined to an intended root where practical.
  • The chroot root is protected; writable children are explicit.
  • Code/releases, runtime uploads, and caches are separate.
  • No web root or application code directory is world-writable.
  • SELinux labels are persistent and limited to required paths.
  • PHP-FPM is not reachable from an untrusted network.
  • Both FTP and PHP-FPM identities have been tested with harmless files.
  • Logs are monitored for repeated denied writes and unexpected path attempts.

The Bottom Line

Fix FTP write denial layer by layer: enable the required vsftpd write policy, prove the real Unix identity can traverse and write the host path, account for chroot mapping, and then resolve SELinux labels or booleans when enforcing policy is involved. Share only dedicated runtime directories between FTP and PHP-FPM; never use chmod -R 777 as a substitute for that design.

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

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.