Use Linux chown to assign a file or directory to the correct user, group, or both. On a VPS, the safest pattern is to inspect the current owner, verify the target accounts, change only the required path, and then verify the result. Ownership and permission bits are separate: chown changes who owns an object, but it does not by itself grant read, write, or execute access.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
What chown changes
chown changes the user owner, the group owner, or both for each file you name. GNU Coreutils describes it as changing “the user and/or group ownership of each given file to new-owner or to the user and group of an existing reference file.” The command changes ownership metadata; it does not rewrite the permission bits shown by ls -l. If an application still cannot read a file after ownership is corrected, inspect permissions separately with ls -l or stat and use chmod only when a permission-bit change is actually required.
As an Amazon Associate I earn from qualifying purchases.
Recommended Free Tools
Changing ownership is normally a privileged operation. On most modern Linux systems, an ordinary account cannot assign a file to an arbitrary user, and changing a group is subject to local policy and group membership. That is why VPS administration examples commonly use sudo. A command that prints an error or returns a nonzero status has not completed the job, even if some files earlier in a list were changed.
Correct syntax and owner/group forms
The canonical forms are:
chown [OPTION]... [OWNER][:[GROUP]] FILE...
chown [OPTION]... --reference=RFILE FILE...
The owner/group operand contains no embedded spaces. Use a quoted path when a filename contains spaces, and put -- before a path that could otherwise be interpreted as an option.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
| Form | What changes | Example |
|---|---|---|
USER |
Only the user owner | sudo chown deploy /srv/app/config.yml |
USER:GROUP |
User and group ownership | sudo chown deploy:www-data /srv/app/config.yml |
:GROUP |
Only the group owner | sudo chown :www-data /srv/app/config.yml |
USER: |
User owner and that user’s login group | sudo chown deploy: /srv/app/config.yml |
| Numeric user or group ID | The numeric owner or group ID | sudo chown 1001:1001 /srv/app/config.yml |
--reference=RFILE |
Copies both user and group from a reference file | sudo chown --reference=/srv/app/template.conf /srv/app/config.conf |
Names such as deploy and www-data are easiest to review during routine administration. Numeric IDs are useful when two systems use different account names but must agree on the underlying IDs, such as when files move between hosts or containers. Confirm the IDs and accounts on the VPS before applying either form.
Inspect the VPS before changing anything
Start with the exact path and its current metadata. A long listing gives a quick view; stat provides unambiguous numeric IDs and mode details.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →ls -l /srv/app/config.yml
stat /srv/app/config.yml
Confirm that the intended user and group exist locally:
id deploy
getent group www-data
These checks prevent a typo from becoming a deployment failure. They also reveal whether a path is a regular file, directory, or symbolic link before you choose recursive or link-specific options. Decide the narrowest scope that solves the problem: a single configuration file is easier to audit than an entire application tree.
A safe, repeatable VPS workflow
- Identify the target. Write down the absolute path and decide whether the change applies to one object or a directory tree.
- Record the current state. Run
ls -lorstatand note the existing user, group, file type, and permission bits. - Verify account names or IDs. Use
id USERandgetent group GROUP; do not assume an account exists just because a deployment script refers to it. - Choose the smallest owner expression. Use
USERfor an owner-only correction,:GROUPfor a group-only correction, orUSER:GROUPwhen both are wrong. - Run with appropriate privilege. Prefix the command with
sudoif your account is not allowed to change the object. - Limit recursion. Add
-Ronly when every descendant in the named directory should receive the new ownership. - Verify the result and status. Re-run
ls -lorstat, and check the command’s exit status. GNU documents zero as success and a nonzero value as failure. - Test the application separately. If this was a deployment repair, exercise the affected service after verifying metadata. A successful ownership change is not proof that the service can read or write the file.
Common ownership changes
Change only the user owner
Use this when the group is already correct and should remain untouched:
sudo chown deploy /srv/app/config.yml
Every named file can be listed in the same command, so you can make a deliberately small batch change:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
sudo chown deploy /srv/app/config.yml /srv/app/.env
Change both user and group
This is common when a deployment account owns application files while a web-service group needs group-level access:
sudo chown deploy:www-data /var/www/app/index.html
The command sets the user owner to deploy and the group owner to www-data. It does not alter the read, write, or execute bits; check those independently.
Change only the group
Keep the current user owner and replace only the group:
sudo chown :www-data /var/www/app/uploads
This form is useful when files were created by the right account but assigned to an unsuitable group.
Set the user’s login group
A trailing colon with no group name selects the specified user’s login group:
sudo chown deploy: /srv/app/config.yml
Use this only when that account’s login group is the group you intend to assign; verify it with local account information first.
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
Copy ownership from a known-good reference
--reference=RFILE copies the reference file’s user and group ownership to the target:
sudo chown --reference=/srv/app/template.conf /srv/app/config.conf
This avoids retyping names when a matching file already has the desired ownership. It copies ownership, not the reference file’s permission bits or contents.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsRecursive ownership with -R
-R (or --recursive) descends through a directory and changes every descendant reached by the operation. For an application tree:
sudo chown -R deploy:www-data /var/www/app
Because the scope includes all descendants, check the path carefully before pressing Enter. A misplaced slash, a symlinked directory, or a path broader than intended can affect unrelated data. Prefer a specific application directory over a filesystem-wide path, and avoid recursion when a single-file command is sufficient.
Symbolic-link traversal options
GNU chown provides -H, -L, and -P to control symbolic-link traversal during recursive operation.
| Option | Recursive behavior | Safety consideration |
|---|---|---|
-P |
Do not follow symbolic links; this is the default when no traversal option is supplied. | Usually the safest default for a narrowly scoped tree. |
-H |
Applies the command’s documented command-line link handling while traversing recursively. | Use only when you understand which link arguments must be followed. |
-L |
Follows symbolic links during recursive traversal. | GNU warns that combining -L with -R can create a security risk if an attacker introduces a link to an arbitrary target. |
Unless a documented exception requires traversal, retain the default non-following behavior. A link itself can also be handled explicitly with -h (or --no-dereference) where supported:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteRank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
sudo chown -h deploy:www-data /srv/app/current
Link behavior has edge cases that vary by implementation, so check the manual for the distribution running your VPS before relying on a particular symbolic-link result.
Why a web server may still fail after chown
Deployments often involve two identities: the account that uploads or builds files and the account used by a web service. Assigning deploy:www-data can make the ownership model match that arrangement, but it does not automatically make the service able to read every file. Permission bits still have to allow the required operation, and directory paths must be accessible to the service account.
Diagnose this in two separate stages:
- Confirm the metadata change with
statorls -l. - Inspect the mode bits and the service’s actual account, then adjust permissions with
chmodonly if that is the identified problem.
Do not use a broad recursive ownership change as a substitute for understanding which process needs access. Keep secrets and writable directories in the smallest scope that meets the application’s design.
Free tools Windows power users keep installed
One-click scans. No signup required.
Names versus numeric IDs
GNU documentation accepts symbolic names and numeric user or group IDs. Names make commands self-explanatory:
sudo chown deploy:www-data /srv/app/config.yml
Numeric IDs make the intended identity independent of local name resolution:
sudo chown 1001:33 /srv/app/config.yml
Before using IDs, obtain the values from the target VPS and ensure they represent the accounts you intend. An ID that meant one account on a source system can represent a different account on the destination. For ordinary, manually reviewed administration, names are generally easier to audit; for cross-system synchronization, verified IDs can be the precise choice.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Handling paths safely
Quote a filename containing spaces or shell metacharacters:
sudo chown deploy:www-data '/srv/app/release notes/config.yml'
Use -- when a filename begins with a hyphen or could otherwise be parsed as an option:
sudo chown deploy:www-data -- '-config.yml'
Prefer absolute paths in deployment procedures. They make the command independent of the shell’s current directory and reduce the chance of changing a similarly named file elsewhere.
Troubleshooting failed or unexpected results
“Operation not permitted” or a similar privilege error
Check the diagnostic text and exit status first. Confirm that you are targeting the intended object and rerun with sudo if your account is authorized to elevate. If policy still rejects the operation, the VPS account, filesystem, or group rules do not permit the requested ownership change; do not treat the file as fixed.
“No such file or directory”
Recheck spelling, capitalization, the current working directory, and whether a deployment has replaced the path. Use an absolute path and inspect the parent directory before retrying.
The owner changed but the service still cannot access the file
Verify the resulting owner and group, then inspect permission bits with ls -l or stat. Since chown does not change those bits, an access failure can remain even after a correct ownership change. Test the service separately rather than assuming the command repaired the deployment.
A recursive run affected an unexpected target
Stop further changes, record the command and path, and inspect the affected tree. Review whether a traversal option such as -L was supplied and whether a symbolic link redirected the operation. For future runs, use the default -P behavior, a narrowly scoped path, and a nonrecursive command whenever possible.
Choosing the right command quickly
| Goal | Command pattern | Scope |
|---|---|---|
| Correct one user’s ownership | sudo chown USER FILE |
One or more named files |
| Set user and group together | sudo chown USER:GROUP FILE |
One or more named files |
| Correct only the group | sudo chown :GROUP FILE |
One or more named files |
| Match an existing known-good file | sudo chown --reference=RFILE FILE |
Copies both ownership fields |
| Apply to a complete application tree | sudo chown -R USER:GROUP DIRECTORY |
Every descendant reached recursively |
| Change a symbolic link itself | sudo chown -h USER:GROUP LINK |
The link, where supported |
The practical rule is simple: inspect first, use the narrowest owner/group form, reserve -R for a deliberately chosen tree, avoid following links unless required, and verify both the metadata and the command status afterward.
Quick Recap
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.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →




