?
Solved

linux file permissions to modify but not delete

Posted on 2005-03-24
1
Medium Priority
?
1,475 Views
Last Modified: 2011-09-20
I have a linux directory with files and sub-directories.

I want one assign a group the permission to modify and add files and directories, but not to delete files or directories.

With only read/write/execute available, how do I do this.
0
Comment
Question by:patrick20001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 16

Accepted Solution

by:
JammyPak earned 2000 total points
ID: 13624626
you need to set the user owner of the entire directory (and all subdirs and files) to be a user who is not in the group (ex. root)
then set the sticky bit on the dirs and all subdirs

ex. /tmp/data is the dir, and 'group' is the group name

chown -R root.group /tmp/data
chmod -R 1770 /tmp/data

This gives full rights to root and to the group, but the sticky bit means that only root can delete any files or folders (only the user owner can, that is)

When users add files, they will become the user owner, so I would schedule a cron job to regularly re-run the 'chown' to set root as the file and directory owner again
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question