LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   non standard [custom] directory structures (https://www.linuxquestions.org/questions/linux-desktop-74/non-standard-%5Bcustom%5D-directory-structures-474114/)

ayteebee 08-15-2006 01:06 PM

non standard [custom] directory structures
 
I was wondering whether it was a bad idea to have a non-standard directory structure on my system.

The standard structure seems to be something like:
/home/$USER/ [$USER's home directory]
~/ [a shortcut for the above]
/bin/ [binaries (programs) that are accessible by anyone]
/sbin/ [binaries that are accessible only by the super user]

And so on and so forth.

I didn't like this system because it doesn't seem to allow much sharing of files between users. It can be done, certainly, but it just seemed a bit cumbersome. I am the only person who uses my computer in my house, and I wanted to have things like my music collection available for all users - when I'm root I still want to be able to hear it and you never know, I might one day have a guest user who also wants to hear some music. The structure I opted for is one where most of the files and stuff are stored in the root directory. It goes something like this:

/snd/ [where I keep all sound files, such as edited snippets, system sounds, etc]
/img/ [images. This directory is a categorised into subdirectories, a system that works well with Digikam]
/music/ [my music collection]
/downloads/ [downloaded files from the internet]
/backup/ [mount point for another HDD for when I back up. Which I haven't done for a very long time, come to think of it...]
/stuff/ [storage place for general crap]
/school/ [hey, I should be able to delete this soon! :D ]

That's pretty much the gist of it. All directories have permissions rwxrwxrwx (or 777) so that all users can use them. Can anybody see any problems with this - I know that most of the protocols that have been developed in Linux developed the way they did for a good reason and I don't want to find out why! (Not the hard way, anyway). For example, if I accidentally download a malicious program into /downloads/ have I circumvented the security measures inherent in the Linux system?

Does anybody else have a non-standard directory structure?

mad4linux 08-15-2006 02:07 PM

just leave the directory structure and put your dirs mentioned into /home/
put all of your created dirs to the group "users" and give all privileges on the dirs to user and group
Code:
Code:

cd /home
mkdir sound

mkdir for all directories you want
Code:

chgrp users sound
chmod 775 sound

again for all dirs you have created

now, everybody belonging to the group "users" can access those dirs and write to them.

toreric 08-15-2006 02:23 PM

caution!
 
I would strongly recommend not to alter any of your basic directory structure (Linux is based on a certain given structure, you can study the topic in various documents).

You apparently need a public directory. I am not sure what would be best, but you can definitely add a 'public root' directory as ~/public , say, in your home directory, and grant any rights needed to that in order to give anybody access to anything in it. Alternatively, you may put such a public root in the var or usr (or var/local or usr/local) directories, but I'm not enough certain to give a clear recommendation. Check also whether those places are installed on different disk partitions having enough disk space.

Such an addendum to your directory structure would not be called 'non-standard'.

mad4linux 08-16-2006 11:45 AM

put all your data files into /home
this is your playground, where userfolders are created, usually having the same name as the user that owns it, and all user data like texts, images, sounds are stored.
you can create /home/public or just the /home/sounds /home/pics ... folders if you wish to give all users (write-)access to those folders. The /home/public/sounds idea may be better for ease of use.
Note as well that users of the same group usually have read access to the folders of each other.

toreric 08-16-2006 01:28 PM

Quote:

Originally Posted by mad4linux
... create /home/public or just the /home/sounds /home/pics ... folders ...

Maybe a silly question, but do you mean 'user folders' with another user (yourself) as the real user? I like it, if there aren't any 'system drawbacks' that may pop up one day?!

mad4linux 08-17-2006 11:59 AM

Quote:

do you mean 'user folders' with another user (yourself) as the real user? I like it, if there aren't any 'system drawbacks' that may pop up one day?!
well, on my system at home, where i know all users and know that they are 'friendly users', i just create folders for my own user and give full rights on them for the 'users' group. a ls -l in /home may look somewhat like this:

Code:

mad4linux@danux:/home> ls -l
totally 36
drwxrwxr-x  25 mad4linux users  4096 ... allusers
drwxr-xr-x  48 mad4linux users  4096 ... mad4linux

...

with the 'allusers' folder open for all group members and 'mad4linux' as the personal folder for the user mad4linux (my own user)

if you have a system with possibly unfriendly users (or just unknown users), it could be better to create a special user named somewhat like 'open4users'. If this user doesn't belong to any other group then users, i personally can't see any special problems related to such an open folder.


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