Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 6926  / 1 Year ago, wed, december 14, 2022, 7:42:51

I am root. I want to make a directory, SuperSensitiveDirectory, private so that only root can even read the files inside it and its sub-directories. There are passwords in these files, and they should not be visible to any users besides root.
There are two log files in a sub-directory of my SuperSensitiveDirectory, though, that I want to be visible (though not writable) to everyone.



Ideally, I'd make SuperSensitiveDirectory private and add some kind of exception for the log files. How can I do this?



If if can't be done, is there a way to recursively change all the files in SuperSensitiveDirectory to 700 permissions? If I did that, I could then individually change the permissions for the log files.


More From » permissions

 Answers
1

If you make your directory permission to 700 by



$ chmod -R 700 foo


and even if you do 777 to any other file inside it, then any other user cannot access the directory contents. So ultimately making the files inside it unreadable.



To resolve that you can create symbolic links of your log files in a directory with public read permissions, and also give read permissions to the links also.


[#24398] Wednesday, December 14, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tresein

Total Points: 197
Total Questions: 113
Total Answers: 112

Location: Hungary
Member since Wed, Nov 9, 2022
2 Years ago
tresein questions
Tue, Jun 28, 22, 17:57, 2 Years ago
Sun, Apr 3, 22, 07:11, 2 Years ago
Thu, Feb 3, 22, 18:03, 2 Years ago
Sat, May 13, 23, 13:00, 1 Year ago
;