LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-08-2011, 08:24 AM   #1
sunny8107
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Rep: Reputation: 0
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!
 
Old 03-08-2011, 09:41 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
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 "..".
 
1 members found this post helpful.
Old 03-08-2011, 10:14 AM   #3
sunny8107
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by MensaWater View Post
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
User Home Directory now owned bt Root AndeAnderson Linux - Newbie 4 10-09-2009 04:52 PM
root-owned file is able to be deleted with my non-root account win32sux Linux - Security 3 11-18-2008 03:00 AM
Tiger checks Ubuntu get fail message root directory owned by user argh2xxx Linux - Security 2 10-20-2008 10:33 AM
How can I have a script owned as root and run as root by a user: setuid? stickey bit? abefroman Linux - Newbie 9 04-19-2008 06:15 PM
vfat mount - all files are 'root' owned, but even root can't -WX d33pdream Linux - General 5 02-28-2003 03:38 AM


All times are GMT -5. The time now is 04:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration