LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Permissions and directories (https://www.linuxquestions.org/questions/slackware-14/permissions-and-directories-586262/)

arubin 09-21-2007 02:45 AM

Permissions and directories
 
I am trying to puzzle out a permission issue.

I have a partition with a mountpoint /mnt/documents

/mnt/documents is of course owned by root and only root has write permission.

I want users to be able to copy folders and files into /mnt/documents but they are not allowed to. Of course I could setup /mnt/documents/user/ with full user permissions but this seems like an unnecessary layer. I do not want to give users write permission for /mnt/documents because then they could potentially delete the directory.

So how do I give users permission to copy to /mnt/documents/ without write permission for the /mnt/documents file itself?

TIA

Pau Gasol 09-21-2007 02:51 AM

EDIT: Didn't read well the first post, sorry

ghostdancer 09-21-2007 02:57 AM

I think, you can setup the directory like /tmp so any users can write to that directory, but they can only handle their own files or directories, but not those owned by others.

Code:

$> ls -ld /tmp
drwxrwxrwt 20 root root 4096 2007-09-21 15:37 /tmp/

$> chmod u=rxw,g=rxw,o=rxw+t /mnt/documents
$> ls -ld /mnt/documents
drwxrwxrwt 2 root root 4096 2007-09-21 15:51 /mnt/documents/

You are doing this as a backup storage for your users?

arubin 09-21-2007 03:11 AM

These are either backup files or shared files.

So setting up the directory as drwxrwxrwt should not case any problems with the directory itself being deletable by any user?

ghostdancer 09-21-2007 03:21 AM

Quote:

Originally Posted by arubin (Post 2898877)
These are either backup files or shared files.

So setting up the directory as drwxrwxrwt should not case any problems with the directory itself being deletable by any user?

Is just like tmp, anyone can write into it and manage those files/directories belong to him. Only root has the ownership of tmp, so only root can delete the entire /tmp directory.

You can just create a /t directory in root, switch normal user do: "cd /t ; mkdir ttt; touch aa ; rm -rf /t" -> You will get permission deny for those that you have not ownership, only those that belongs to you gets deleted.

The directory is not delete-able by any user, it is just write-able by any user.

arubin 09-21-2007 03:28 AM

Thanks.

Alan

ghostdancer 09-21-2007 03:56 AM

You welcome. Glad to know this solved your problem.


All times are GMT -5. The time now is 05:10 PM.