Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a raid partition mounted to /data. My samba's homes and public paths are set to /data/home and /data/public. I'm wondering if I should 'chmod 777 /data' so that when a user makes a folder in public, any other user can edit it. I think what I'm asking for is how do I make it so every other directory made in /data cascades so that the user who made it doesn't have to be the user to edit/delete it.
Distribution: Lots of distros in the past, now Linux Mint
Posts: 748
Rep:
You can do it that way, but that last '7' might be a problem, as it would allow anyone (internet users as well) at all to carry out the same actions. In this case, it might be better to create a new group, add the relevant users to that group, then set the permissions to 770, meaning user (owner) and group could use it, but restricting 'other' users.
Depending on the number of users, of course, you may want to look into ldap, to ease things like this, as well as enable your users to work from home, etc.
The problem is that users on your system will have umasks like 022 or 027. 022 means that when they create files they are only writable by themselves, and with 027 they aren't accessible at all by others. You could change the umask to 000 for all your users but this is a very BAD IDEA. It basically means that by default any file your users create (anywhere, including their home directories) will be readable by others.
A better solution is to make a group called 'public' (or whatever you want) and make it the group owner of /data/public and everything in it. Then set groupid in the permissions on the /data/public directory. That way whenever someone creates a file or directory under /data/public it will have group ownership of 'public' and anyone in the group public (add all your users into that group) should be able to access it.
Thanks for the posts guys, just a followup. I put all the created users in a group called data, then I did
chmod 770 /data
chmod 770 /data/public
chmod 770 /data/home
All the users have their own directories in home, but my problem is when I log into say the user 'office' and store a bunch of files in its own directory under home, the user 'family' also has those files in his directory. Any chmod variation to stop this?
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282
Rep:
That's rather strange... you're saying that when you put files in /home/office, they automatically appear in /home/family?
Firstly check that the users have separate home directories - you can do this by either outputting the results of your /etc/passwd file (use the command 'cat /etc/passwd | grep "office|family' ), or by logging in as each user, going to their home directory and issuing the command 'pwd'.
If the directories are actually different, then see whether the files are actually copied to family or simply linked - use 'ls -l' on the files both in office's home and family's home.
Let us know the output of both commands; I can say now, I highly doubt this is anything to do with chmod. chmod only modifies who can access files and do what to them, it shouldn't create any kind of mirroring effect (or create anything at all).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.