I'm searching for a workaround for creating a folder which will be fully co-used with root and user including new subdirectories.

Example of usage:
I have an application which sometimes needs to run under root. The application has some global configuration files and project configuration files and some project files. While it is working the application can create, edit, delete files and create, edit, delete folders. I want to run the application after under user and not have any issues with permissions.

Are there any workarounds for a scenario like this?

All "duplicate answers" were not able to resolve my issue.
You still can't create subdirectories which will inherit permission rules.

I need to allow this scenario:
We have a shared folder called "test".


mkdir dir1 // under test folder
cd dir1
touch file1 


cd test/dir1
rm file1
  • 1
    Probably easiest is not to run as root. Otherwise it is the same as sharing any other directory / file with any other user with the exception of the security implications. In general, IMO , any files shared as root should be owned by root and ro by other users. See askubuntu.com/questions/291501/… – Panther May 2 '14 at 22:53
  • I agree with You about security purposes, but due developing purposes You sometimes need open ports in root range ( < 1024) under IDE or some other priviledged actions. I found only one suitable scenario for me - always run under root, but IMO is more secureless then share several directories. – Yulaw May 4 '14 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.