Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 7596  / 1 Year ago, mon, march 20, 2023, 9:39:27

I am having below directory structure.



/DR/Sub/X1/...
/X2/...
/X3/...
.......


I want to give acces permissions to user but in below manner,
when ever i create new directory like X1,X2,X3 suppose i create X4
i want to create new user for this new directory which will only and only access /DR/Sub/X4/... directory.....i.e. new user for new directory how can i achieve this.



Thanks in advance..


More From » permissions

 Answers
2

The following commands will create user X4 and (by default) group X4 and directory X4, and will limit access to directory X4 to user X4 exclusively.



sudo adduser X4
sudo mkdir X4
sudo chown X4:X4 X4
sudo chmod 0750 X4


Note that nothing will prevent X4 from rummaging around elsewhere on the file system. There is no way to prevent that. However, no one except X4 and root will be able to access directory X4.


[#27032] Tuesday, March 21, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fittecanap

Total Points: 322
Total Questions: 100
Total Answers: 105

Location: Israel
Member since Tue, Nov 17, 2020
4 Years ago
;