LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Rights (https://www.linuxquestions.org/questions/slackware-14/rights-39851/)

BoonZie 12-31-2002 08:02 AM

Rights
 
I have created a server for our network at home. On that server I have a folder named Filer. I want all users to be able to use this as a shared folder. All users shall be able read and write in this folder and the folders/files within it, and also read and write in each others folders and files.
I used "chmod 777 Filer" to set the rights for my "1:st" folder, and that works fine, but I also wants everything in that folder to automatically get the same rights. Even when a new folder or file is created I want it to get that rights automatically.
Can this be done? And in that case how?

niknah 12-31-2002 09:01 AM

what do you mean by rights?

If you type...
chmod 2777 Filer

...all new files in the Filer folder will be set to the same group as whatever group owns Filer.

if you mean you want everyone to be able to read/write files someone else creates in that folder, then before someone uses that folder they may need to type...
umask 002

to allow anyone in your group to write to it.

BoonZie 01-01-2003 08:26 AM

Hi
Thanks for answering.

Well, what I want is everyone to be able to read and write to every file and folder in my "Filer"-folder, and also every sub-folder in that directory. So i think what you describe is what i want, but I donīt really understand...

Lets say a user creates a folder named "Pictures" (in my Filer-folder) and in that folder saves a file named "pic1", that I wants to read, edit and then save again.
What shall the other user write, and does he have to write the same again if he then stores a file pic2?

In Swedish we call it rights, Iīm not sure what you call it English...

MasterC 01-01-2003 09:07 AM

Permissions.

Language barriers are cool sometimes, like pissed, I really like that one ;)

Your question:

I'd think that by adding these users to the same group, owning that directory and all subdirectories to this group, and allowing world perm's on it should give you the desired "permissions" you'd want.

So let's say you have Tom, John, Rob, and Carl. The folder you want to give everyone permissions to is /mnt/stuff

So we'd need to create a group:
vi /etc/group

And call it whatever you'd like, give it a special GID, I'd say something like 77777. Just something that isn't in use, and never will be by any normal user/process.

So now the last few lines in your /etc/group file might look like this:
users::100:tom,rob,carl,john
console:x:101:
newgroup:x:77777:tom,rob,carl,john

Ok, so now you need to own the directory and it's subfolders:
chown -R nobody:newgroup /mnt/stuff

This makes nobody the owner, and newgroup the group owner. Now we will chmod the directory and it's sub:
chmod 2777 -R /mnt/stuff

Now everyone in newgroup should be able to read/write/execute everything in the directory and it's subdir's. And from the post from niknah I am assuming the 2 before the 777 makes each new file have the same group ownership as the original folder.

Ok, so now I think that's it...

Cool

BoonZie 01-02-2003 01:12 AM

Languages, Languages...

OK, I think I understand you. I will try that out, and tell you how it goes.

Thanks guys

BoonZie 01-02-2003 03:55 PM

Well, it works fine with the files and folders that are in the directory when I do as you said. The problem now seems to be the new files. They don't inherit the settings from the Filer-folder, they are created as usual.
Is it possible to change the "standard-settings" for how files are saved in the whole system?

niknah 01-02-2003 10:18 PM

they don't inherit the group? or the rwx..... permission bits?

add a "umask 002" line to the end of the /etc/profile file.

this will make sure all new files are writable by the users's group.

BoonZie 01-04-2003 04:00 PM

I tried, but I'm not sure if I have to make the os read the profile file again?
In that case how?
Will it work if the groupmembers connect both with samba and nfs?

MasterC 01-04-2003 06:48 PM

To have them "Reread" the /etc/profile without rebooting (as each user):
source /etc/profile

And I've got no idea about samba and NFS, but one would think that the answer would be yes, it will work.

Cool


All times are GMT -5. The time now is 07:52 AM.