Table of contents:
2024 Author: Malcolm Clapton | [email protected]. Last modified: 2023-12-17 03:44
Although such a problem, when you lose access to a file, is quite rare, it can still happen, for example, when your permissions are changed by a third-party application.
Usually this problem is eliminated by starting the process of restoring user rights (run Disk Utility from the / Programs / Utilities folder, select the partition and click on the Restore access rights button), but this does not always work. To deal with the problem, you need to configure the rights to problem files.
In such situations, you have two ways: to change the rights to the file (s) manually through the Finder or through the Terminal. We will consider both methods, although for advanced users it will be much easier and faster to use the Terminal.
Change file permissions using Finder
You can change file permissions through the Properties window:
- Select the file in Finder, then press Command + i to bring up the Properties window.
- Click the arrow next to Sharing and Permissions to see who owns the file and see the permissions.
- Select the lock icon to unlock the "Rights".
- Click the [+] button to add a new owner, then select a user from the list and click Select.
- Now select a name and click on the gear icon by selecting Make (username) owner.
Through the Terminal, the recovery process is faster and, as you will see, easier.
Change file owner from Terminal with chown command
Using the Terminal is generally considered a way for advanced users, but in some situations it is not only faster, but also easier.
To do this, we use the chown command, which is standard for Mac OS X.
First, launch Terminal from / Programs / Utilities /.
Syntax:
chown [username] [file]
Usage example: to change the owner of a file named "test-file.txt" for user "tanya" the command would look like this:
chown tanya test-file.txt
Keep in mind that the username you will be using is the short account name, which is usually the same as the name in the user folder.
If you are not sure if the short username is correct, enter ‘Whoami’ in Terminal to get the current short name or type “ls / Users” to see a list of all user accounts on the current Mac.
If you change the permissions on system files or files of other users to which you do not have read / write permissions, then you will need to use the chown command along with ‘sudo’.
sudo chown tanya ~ / Desktop / test-file.txt
To change the group of files, use chown with a colon after the short username:
sudo chown tanya: staff ~ / Desktop / test-file.txt
The choice of how to solve the problem is always yours.
Recommended:
35 Free Apps That Will Help Any Apple Watch Owner
These Apple Watch apps help you travel, track health, exercise more effectively, and get better at everyday tasks
How the owner can infect a pet
We found out whether cats are sick with coronavirus and whether candidiasis is transmitted to dogs. And also how to protect your pet from feeling unwell, especially if you smoke
6 tips for effective memorization from the owner of a phenomenal memory
Lifehacker publishes an excerpt from Idriz Zogai's book "Minne, or Memory in Swedish". From it you will learn how to teach the brain to assimilate information qualitatively
Why tenants are dangerous: 9 fears of the owner
Renting out an apartment is always fraught with a number of difficulties, but if you thoroughly study this topic, then various risks can be minimized
What prevents you from becoming the owner of an aspen waist
A thin waist and elastic abdominal muscles are a desirable goal, on the way to which many mistakes can be made. We will analyze the most common ones