'Linux File Permissions Read Access to Owner
What command could I use to grant read access to the owner of the file? The current permissions are d-w-r--r--.
Why is this answer correct ?
chmod 644 honey_bears
And why is this answer wrong?
chmod 400 honey_bears
My reasoning:
This command chmod 644 honey_bears will give read and write permissions to the user, and read permission to the group and other users.
However, the question asked above asks us to give read access to the owner of the group.
What am I missing here?
Also for chmod 400 honey_bears the 4 will give read access to the user. Should that not be correct?
Thanks.
Solution 1:[1]
What command could I use to grant read access to the owner of the file? The current permissions are
d-w-r--r--
.
Well, by telling the current permissions, I assume, that the question wants to keep the already existing permissions, so to change it to drw--r--r--
the command is chmod 644 honey_bears
. chmod 400 honey_bears
removes the already existing permissions and changes the permissions to dr---------
However, the question asked above asks us to give read access to the owner of the group.
The group has alredy read permission. If something is unclear, permissions are explained here.
Hope this helps.
Solution 2:[2]
I'd advise you to first, try to understand how the file permissions work, using the chmod u+r
feature, and once you understand this, try to translate this into chmod 404
.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | TheAdam122 |
Solution 2 | Dominique |