Re: How to disallow a user removing a directory but allow removing files within it?

From: Antoine EMERIT (reply_to_replay_at_daubededaube.nothing)
Date: 04/25/04


Date: 25 Apr 2004 19:47:23 GMT

Kai Schaetzl <ng@conactive.com> wrote
news:VA.00003075.01f971ac@conactive.com:

> Problem is this:
> Many of our ftp users delete certain necessary directories in their
> home directories. To avoid the problems related to this I made those
> directories owned by root. All the files within that directory are
> still owned by the user and writable by him. The problem is he can't
> remove the files. The user can still write to the files, but he can't
> delete them. Is there a way to give the user delete "permission"?
> (They only need read and delete permission.)

There is no 'delete' permissions.

A file or a directory can be delete if you can modify (write access
enable) the directory that content it.

So to 'protect' a directory you should disable writing in its parent
directory.

In your case you have disable write access (because of the default group
permissions flag) to your concerned directory and so user can't remove
their file.

Set the parent directory of you concerned directory to the root owner or
remove its write permission flag.

But your user won't be able to create file or directory in this parent
directory.

There is other way to solve your problem (sticky bit, user/group/other
permission, ...), but you need to give us more information :

- chrooting user access in the home directory ?
- other way to access the home directory ?
- need to write in the parent directory ?
...

Regards



Relevant Pages

  • Re: FTP User Isolation Mode Questions
    ... account doesn't have WRITE NTFS permission. ... is it possible to get the FTP service to follow shortcuts used as home ... directories or placed on the root of a physical home directory? ... > I would like to set up anonymous access on my FTP site, however, I do not> wish anonymous users to have upload permission. ...
    (microsoft.public.inetserver.iis.ftp)
  • Re: Disappearing Folders/Folder Creation Problems
    ... If there's nobody else with root then you have a problem. ... In order to traverse to their home directory ... their user needs to have that x permission. ... around it" and then subsequent updates haven't taken the same steps. ...
    (comp.mail.imap)
  • Re: Problems configuring wu-ftpd
    ... >> the user doesn't have permission to view the incoming directory? ... >> Is it files in your incoming directory that your having problems with? ... > would be a closer configuration regarding squid.....but for a guest is ... wu-ftpd only has access to it's home directory, it is chrooted or jailed there ...
    (Debian-User)
  • [SLE] NFS from 9.1 to 9.0
    ... I just discovered that permission is denied if I try to transfer files from my ... home directory on 9.1 to my home directory in 9.0, ... NFS to move it to desktop A, copy it to a floppy and load ... causing problems for someone else. ...
    (SuSE)
  • Re: su
    ... >> check the parent directory or to that matter check your home directory ... >> owner to see if you own it. ...
    (alt.os.linux.redhat)