LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Installing as non-root in a root owned directory (https://www.linuxquestions.org/questions/linux-newbie-8/installing-as-non-root-in-a-root-owned-directory-867201/)

sunny8107 03-08-2011 07:24 AM

Installing as non-root in a root owned directory
 
All,
I have a machine which has only /opt with some decent amount of space where I can install a software. /opt belongs to root:root. The software I want to install cannot be installed as root user.
So lets say I create a directory called /opt/install1 and then chown -R install1 to belong to user1. And now I install the software under /opt/install1 with user as user1.
Is this a best practice violation? There could potentially be just /opt/install1 belong to user1 and in future everything else created under /opt belonging to root..Thanks!

MensaWater 03-08-2011 08:41 AM

This is not a "violation" or even a problem. It is normal that higher level directories are inaccessible by users and subdirectories are chown'ed to be accessible the way you suggested.

If you think about it / which is the top of the hierarchy is never owned by any regular user yet any other subdirectories on the system may be. A good example is /home. The directory itself is not owned by any specific user yet all of the home directories under it are owned by their respective users.

CAUTION: If you use "-R" with chown be sure NEVER to do "chown -R .*" as that would make it chown the parent directory and all its other subdirectories because ".*" would match "..".

sunny8107 03-08-2011 09:14 AM

Quote:

Originally Posted by MensaWater (Post 4282778)
This is not a "violation" or even a problem. It is normal that higher level directories are inaccessible by users and subdirectories are chown'ed to be accessible the way you suggested.

If you think about it / which is the top of the hierarchy is never owned by any regular user yet any other subdirectories on the system may be. A good example is /home. The directory itself is not owned by any specific user yet all of the home directories under it are owned by their respective users.

CAUTION: If you use "-R" with chown be sure NEVER to do "chown -R .*" as that would make it chown the parent directory and all its other subdirectories because ".*" would match "..".

Thanks!


All times are GMT -5. The time now is 05:34 PM.