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.

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

Use Linux chown to change the user owner, group owner, or both for files and directories on a VPS. The safest workflow is to inspect the current state, verify the target accounts, run the narrowest command that solves the problem, and then verify the result. Ownership is separate from permissions: chown changes who owns an object, but it does not grant read, write, or execute permission bits.

What chown changes

GNU Coreutils defines chown as changing the user and/or group ownership of each specified file to a new owner, or copying ownership from a reference file. Every regular file and directory on a typical Linux VPS has a user owner and a group owner. Those identities are consulted by the permission model when a process opens, modifies, or traverses the object.

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

Changing ownership is not the same as changing mode bits. If a web process owns a file but the mode still denies reading, the process can fail. Conversely, changing a file to an account that has no useful permissions does not fix access. Use chmod separately when the read, write, execute, or directory-traverse bits also need adjustment.

Canonical syntax and operand forms

The GNU synopsis is:

chown [OPTION]... [OWNER][:[GROUP]] FILE...
chown [OPTION]... --reference=RFILE FILE...

The owner/group operand has no embedded spaces. Quote a path that contains spaces, and put -- before a path that could otherwise be interpreted as an option.

#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.
Form Effect Example
USER Changes only the user owner. sudo chown deploy /srv/app/config.yml
USER:GROUP Changes both the user and group owners. sudo chown deploy:www-data /srv/app/config.yml
:GROUP Changes only the group owner. sudo chown :www-data /srv/app/config.yml
USER: Changes the user and sets the group to that user’s login group. sudo chown deploy: /srv/app/config.yml
Numeric IDs Uses a numeric user ID, group ID, or both; useful when account names differ between systems. sudo chown 1002:1002 /srv/app/config.yml
--reference=RFILE Copies the reference file’s user and group ownership. sudo chown --reference=/srv/app/template.conf /srv/app/config.conf

Use symbolic names for routine administration because they are easier to review. Use numeric IDs when you deliberately need identity matching across machines, containers, or mounted filesystems; verify the IDs first because the same name can map to different numbers on different systems.

A safe VPS workflow

  1. Inspect the current object. Run ls -l /path/to/file for a quick view or stat /path/to/file for detailed metadata. For a directory, inspect the directory itself with ls -ld /path/to/directory so you do not confuse its entry with its contents.
  2. Confirm the identities. Check the user with id deploy and the group with getent group www-data. Correct spelling and confirm that the account is the one intended for the application or deployment.
  3. Choose the smallest scope. Start with one file or one specific directory. Add -R only when every descendant is supposed to receive the same ownership.
  4. Run with appropriate privilege. Prefix the command with sudo when your account is not allowed to change the requested owner or group. On most systems, changing a file’s user owner requires privilege; changing a group is also constrained by local policy and group membership.
  5. Verify the result. Repeat ls -l or stat and inspect the command’s exit status. A zero exit status means success; a nonzero status means the operation failed and the diagnostic must be investigated.
  6. Test the application separately. If the change is part of a deployment repair, make an application request or run the relevant deployment check after ownership is correct. A successful chown does not prove that the service can open every file in the path.

Common ownership changes

Change only the user owner

When the group should remain unchanged, specify only the user name:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo chown deploy /srv/app/config.yml

This is appropriate when a deployment account created a file that should be owned by the service account, while preserving the existing group arrangement.

Change both user and group

Use a colon between the two names:

sudo chown deploy:www-data /srv/app/config.yml

This sets the file’s user owner to deploy and its group owner to www-data. It does not alter any permission bits.

Change only the group

Leave the user portion empty:

sudo chown :www-data /srv/app/config.yml

This is useful when a file already has the correct individual owner but must be associated with a service or collaboration group.

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

Set the user’s login group

A trailing colon with no group name sets the user owner and assigns that user’s login group:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo chown deploy: /srv/app/config.yml

Use this deliberately. It can replace an existing group that other processes rely on.

Copy ownership from a known-good file

--reference avoids manually repeating names when a matching file already exists:

sudo chown --reference=/srv/app/template.conf /srv/app/config.conf

The user and group are copied from the reference file. The reference itself is not modified, and permission mode bits are not copied.

Changing a directory tree with -R

The recursive option, -R or --recursive, descends through a directory and changes every descendant it processes:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.
sudo chown -R deploy:www-data /var/www/app

Recursive scope is the main safety boundary. A typo in the starting path can affect an entire application tree, and a broad path can include logs, uploads, sockets, cache files, or secrets that need different owners. Before pressing Enter, inspect the exact path and consider testing the command on one representative file.

  • Use a one-file command when only one artifact is wrong.
  • Use a specific application directory rather than a parent such as /var or /.
  • Do not assume that one owner/group pair is correct for generated uploads, private keys, runtime sockets, and source files alike.
  • After recursion, inspect several descendants, including a nested directory and a file at the deepest expected level.

Symbolic links and traversal safety

Recursive ownership changes need an explicit decision about symbolic links. GNU chown documents -H, -L, and -P for controlling link traversal during recursive operation. -P is the default when no traversal option is supplied, so the normal behavior does not follow links encountered while descending.

Option Purpose Operational guidance
-P Use the non-following traversal behavior. Preferred default for a narrowly scoped tree unless a documented exception exists.
-H Changes how links supplied as command-line arguments are handled during recursive processing. Use only when you understand which command-line links should be traversed.
-L Follows symbolic links during recursive processing. Avoid unless required; GNU warns that combining it with -R can create a security risk if an attacker introduces a link to an arbitrary target while traversal is in progress.
-h / --no-dereference Changes the link object itself instead of its referent where supported. Check the target distribution’s manual for edge-case behavior before relying on it.

For a tree that contains links, prefer the default non-following behavior and keep the starting path narrow. If you intentionally need a different policy, document why and review the distribution’s chown manual for the exact interaction among -R, the traversal option, and command-line operands.

Fixing a web-server or deployment ownership problem

A common VPS failure occurs when a deployment account creates application files but the web service runs under a different account. First inspect the file and every parent directory:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ls -l /var/www/app/index.html
ls -ld /var /var/www /var/www/app
id deploy
getent group www-data

Decide whether the service should own the file, whether it only needs group access, or whether the deployment account should remain the owner. Then apply the smallest matching form, such as:

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.
sudo chown deploy:www-data /var/www/app/index.html

If many files in that application directory were created by the wrong account, use a carefully verified recursive path:

sudo chown -R deploy:www-data /var/www/app

Ownership alone may not resolve the request. The service also needs permission bits that allow it to read the file and traverse each parent directory. Check those bits with ls -ld, adjust them separately with chmod only when justified, and then test the application. Do not treat a zero exit status from chown as an application test result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Paths, special names, and multiple files

chown accepts multiple file operands, so one command can update a reviewed list:

sudo chown deploy:www-data /srv/app/config.yml /srv/app/.env

Quote paths containing spaces or shell metacharacters:

sudo chown deploy:www-data '/srv/app/release notes/config.yml'

Use -- before a path beginning with a hyphen:

sudo chown deploy:www-data -- '-temporary-config'

The -- marker tells the command to treat following text as a file name rather than another option. Shell quoting and option termination protect the command’s parsing; they do not change the ownership policy you selected.

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.

Numeric IDs and cross-system deployments

Linux stores numeric user and group IDs, while tools commonly display the corresponding names. Names are clearer for ordinary VPS administration, but IDs matter when a shared volume is mounted by systems whose account databases do not agree. For example:

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.
sudo chown 1002:1002 /srv/shared/data.db

Before using an ID, verify it with the local account database and confirm that the target process really runs with that numeric identity. A matching name on two hosts does not guarantee a matching ID, and an ID that is valid on one host can belong to a different account on another.

When chown fails

“Operation not permitted” or “Permission denied”

Confirm that you used sudo where required and that the target filesystem permits ownership changes. Check the exact diagnostic and the exit status rather than assuming the command partially succeeded. A nonzero status means the requested operation was not fully successful.

User or group does not exist

Run id USER and getent group GROUP. Correct the operand or create the intended account through the system’s normal account-management process before retrying. Do not substitute a similarly named account without confirming which service should own the files.

The command succeeds but the service still cannot read the file

Recheck the resulting owner and group with ls -l or stat. Then inspect permission bits on the file and execute (traverse) permission on every parent directory. Use chmod only for the specific mode change required, and verify the service’s runtime account separately.

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

Only some descendants changed

Review the command output for diagnostics, check the exit status, and inspect the affected subtree. Links, filesystem policy, protected files, and an incorrectly scoped starting path can all explain a mismatch. Do not rerun a broader recursive command until the cause is understood.

A symlink changed unexpectedly

Stop and identify whether the command followed the link or modified the link object. Re-read the distribution’s manual for -P, -H, -L, and -h, then repeat with a narrowly scoped path and the intended traversal policy. Never enable -L recursively as a quick fix on an untrusted or mutable tree.

Review checklist before and after running chown

  • Is the path exact, and have you checked whether it is a file, directory, or symbolic link?
  • Do the target user and group exist, and are their numeric identities the ones you intend?
  • Are you changing only the owner, only the group, both, or copying from a reference?
  • Would a one-file command solve the problem, or is recursion genuinely required?
  • If using -R, are you relying on the default non-following behavior or deliberately selecting another traversal mode?
  • Have you considered secrets, uploads, logs, sockets, and other descendants that may need different ownership?
  • Did you quote paths with spaces and use -- for option-like names?
  • Did you inspect ownership again, capture any diagnostic, and check for a zero exit status?
  • Did you test the application separately and verify permissions on parent directories?

Key distinction: ownership versus access

Use chown when the user or group identity attached to an object is wrong. Use chmod when the permission bits are wrong. A complete deployment repair can require both, but they are separate operations with separate risks. Keeping those decisions separate makes a change easier to review and reduces the chance of granting broader access than the service needs.

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.

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