0

We have some EDA software that is used by many people. As a team, we want to be able to edit and work on the same files (binary). Say, I create an electrical schematic, I save it, I simulate it. Apart from the schematic, the software creates a bunch of other files that go along the original schematic. Now how do I make the result of my work available to other users for editing? Surely I can manually use "chmod", chown" etc. but that is not a solution. It has be automatic. I created a folder under the root directory called /Projects. I gave it 777 permissions. Ok, everyone can write in that folder, but the files created by the software get assigned attributes of the user that runs the program. So, if I run the schematic program, and I save that schematic it gets saved with attributes like:

-rw-r--r--  1 peter peter 170M Aug  4 10:22  zoom_amd64.sch

And if John creates a schematic, it gets saved with attributes like:

-rw-r--r--  1 john john 30M Aug  4 12:22  zoom2_amd64.sch

So I cannot edit John's files, and John cannot edit my files even though, we both have r/w access to the /Project folder.

Is there a way to config that folder so people, who belong to a certain group, get to edit all the files in that folder? Users outside of the certain group shall not be able to read or write files in /Projects directory.

  • "I gave it 777 permissions" revert that to 770 please No need for "others" to get access, – Rinzwind Nov 04 '23 at 17:11
  • The classic *nix way to do this is via groups, using the directory's setgid (and possibly sticky) bits - see for example How can I share a directory with an another user? – steeldriver Nov 04 '23 at 17:12
  • That link helps a bit but does not solve the problem entirely. The files created inside the folder inherit the group ownership of the folder above but individual files inside the folder still have permissions "-rw-r--r-- 1 john edagroup" which means they are still not writable by the group members. – Dictador Nov 04 '23 at 18:49

1 Answers1

0

Create a group and add peter and john to that group. Then make the directory that you want them both to store files to x70 (so whatever on user, read+write+execute for group and nothing for others.

Using your admin account create a group with (I used users as a name) and add users to group:

sudo groupadd users
sudo usermod -a -G users peter
sudo usermod -a -G users john

Then setup the directory.

sudo chmod -R 770 /Project
sudo chgrp users /Project
  • executable for owner, users and set it for folder and anything already inside it.

If you create new users use

sudo useradd -g users wim

and it will create wim and add it to users

Rinzwind
  • 299,756
  • I already have this setup. This does not solve the problem. Still, files created under the directory /Project will by default have -rw-r--r-- attributes which do not give write permissions to all group members. – Dictador Nov 04 '23 at 17:22
  • your question states you have "peter" and "john" as a group Not a common group.but there is a chance your answer is inside the config of the eda software,,,, if so we are likely not going to be able to help :) – Rinzwind Nov 04 '23 at 17:23
  • Maybe there is something I don't understand. What do you mean by "common group"? I did create a group "edagroup", I added john and peter to that group. I now I followed your guides and get the same result as described in my question. I did "touch /Project/test.txt". File created inside the /Project folder by user "john" has permissions "-rw-r--r-- 1 john john" which makes it impossible to write to that file by user "peter". Although, the user "peter" can write to folder /Project. "peter" can do "touch /Project/test2.txt" with success, "peter" cannot open "vim /Project/test.txt" for editing. – Dictador Nov 04 '23 at 17:55
  • and is Project set to that group? – Rinzwind Nov 04 '23 at 18:07
  • Yes, Project is set to that group. If it wasn't the users would not be able to write to that folder. Just follow your guide, create a file inside that folder as one user and try to edit the same file as another user. You will see that you will not have the permissions to edit. It also has nothing to do with the EDA software itself. This bahaviour is with every program. Try "vim", "paint", anything. – Dictador Nov 04 '23 at 18:14
  • I think the key is to set "umask", as per the link below, but I am afraid that the result will take effect system wide. I would prefer to have it done only for a specific folder. https://unix.stackexchange.com/questions/394106/how-to-let-users-collaborate-by-editing-files-in-a-shared-directory – Dictador Nov 04 '23 at 18:52