Go Back   openSUSE Forums > Archives > SLS Archives > ARCHIVES - SuSE Linux > ARCHIVES - Network & Security > ARCHIVES - Security
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Security Want to know if you should really apply the latest kernel patch? Want to know how to configure your firewall? Discuss any Security related topics in here!

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 18-Dec-2006, 20:48
vodsonic
Guest
 
Posts: n/a
Default

I'm running SuSE 10.0 on a PC with multiple users. (SuSE owns the box - it's not dual boot.) I'd like to create a shared folder that is owned by two users, such that:

1. Both users can create files in the folder, or move files there.
2. Any files in the folder can be modified by either of the users.
3. Once a file exists in the folder, no permissions need to be changed before conditions 1 & 2 are met (i.e. the folder's permissions would automatically apply to any files placed therein).

I don't mind if this folder resides in the home folder of one of the users, or if it resides elsewhere in the filesystem. The folder does not need to be accessible over a network. The two users will never be logged on at the same time or open the same file at the same time.

I can figure out how to change the permissions of the folder or any files individually, but what I want to do is create a shared workspace where both users have full access to any files placed there, without having to manually change the permissions of each new file.

I'm obviously no expert at Linux, but I can usually figure things out with the help of my reference books and google. This problem stumped me. Everything I found on the web about shared folders and Linux was either about accessing shared Windows folders over a network, or about Apache or Samba. This is just a single box with two users who need a common workspace. I could probably try to use Apache or something, but I hope there's a simpler solution.
  #2 (permalink)  
Old 18-Dec-2006, 21:18
microchip
Guest
 
Posts: n/a
Default

Quote:
I'm running SuSE 10.0 on a PC with multiple users. (SuSE owns the box - it's not dual boot.) I'd like to create a shared folder that is owned by two users, such that:

1. Both users can create files in the folder, or move files there.
2. Any files in the folder can be modified by either of the users.
3. Once a file exists in the folder, no permissions need to be changed before conditions 1 & 2 are met (i.e. the folder's permissions would automatically apply to any files placed therein).

I don't mind if this folder resides in the home folder of one of the users, or if it resides elsewhere in the filesystem. The folder does not need to be accessible over a network. The two users will never be logged on at the same time or open the same file at the same time.

I can figure out how to change the permissions of the folder or any files individually, but what I want to do is create a shared workspace where both users have full access to any files placed there, without having to manually change the permissions of each new file.

I'm obviously no expert at Linux, but I can usually figure things out with the help of my reference books and google. This problem stumped me. Everything I found on the web about shared folders and Linux was either about accessing shared Windows folders over a network, or about Apache or Samba. This is just a single box with two users who need a common workspace. I could probably try to use Apache or something, but I hope there's a simpler solution.
[/b]
chmod 777 /home/your_username/Folder

this will change the permissions on the "work folder" so any user can write to it
I'm not sure how to solve the second question where you want that all files in this folder to be read/write by the 2 users when you create them,... have to search for that myself.
  #3 (permalink)  
Old 18-Dec-2006, 23:31
vodsonic
Guest
 
Posts: n/a
Default

Thanks.

Quote:
chmod 777 /home/your_username/Folder

this will change the permissions on the "work folder" so any user can write to it
[/b]
Yep, that works. But of course the files still belong to the user who created or placed them there.

Surely someone has solved this one before, for a collaborative project or something.
  #4 (permalink)  
Old 19-Dec-2006, 06:27
Zombie13
Guest
 
Posts: n/a
Default

Quote:
Thanks.
Yep, that works. But of course the files still belong to the user who created or placed them there.

Surely someone has solved this one before, for a collaborative project or something.
[/b]
1: Create a new group.
2: chgrp -R <new group> <directory where you want the files written>
3: chmod -R 775 <same directory>
4: chmod -R g+s <same directory> ( I can't remember the octal for setgid.... :unsure: )

That will make the directory read/write by anyone in that group, and (should) make all the files in the the same permissions.

NOTE: This is untested and I am not responsible if you nuclear reactor melts down because user1 couldn't read user2's files... :lol:

Z.

EDIT: Another way to do it is instead of step 4, add the command
Code:
 umask 002
to the .profile for both users. That will make all the files/directories they create have permissions of -rwxrwxr-x, which will allow anyone in the group owning the file to edit it.

Z.
 

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2