Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 2011  / 2 Years ago, tue, april 5, 2022, 2:18:06

I just simply want to give the same attributes I have for "cars" directory to "animals" directory. In other words, how can I de-privilege that specific file in terms of permissions?


drwxrwxrwx 14 root  root  4096 Nov 26 19:41 animals
drwxr-xr-x 2 user user 4096 Nov 16 16:59 cars

More From » permissions

 Answers
6

sudo chown -v user:user /path_to/animals changes both the folder owner and the group from root:root to user:user.


Now that root is no longer the owner, sudo is not needed anymore.


chmod -v 755 /path_to/animals changes the folder's access permissions to the same ones as cars.


If there are files and folders inside the animals folder and you wish to change their ownership and permissions too, add an R next to the -v option so that the commands look like:

sudo chown -vR user:user /path_to/animals

chmod -vR 755 /path_to/animals.


Typing something like file and folder permissions linux on Google, will give you plenty of results on how they work.


[#135] Wednesday, April 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
theurn

Total Points: 30
Total Questions: 110
Total Answers: 111

Location: Bahrain
Member since Fri, Sep 16, 2022
2 Years ago
theurn questions
Mon, Feb 14, 22, 16:29, 2 Years ago
Sat, Apr 8, 23, 05:26, 1 Year ago
Tue, Jan 10, 23, 23:59, 1 Year ago
Fri, Apr 8, 22, 01:36, 2 Years ago
;