To delete a file, what permissions do you need?

Study for the OSCP Linux Exam. Use our flashcards and multiple-choice questions to test your skills. Each query comes with detailed hints and explanations to enhance your preparedness. Get ready to conquer the exam!

Multiple Choice

To delete a file, what permissions do you need?

Explanation:
Deleting a file is a change to the directory’s contents, not a change to the file itself. To remove an entry, you must be able to modify the directory, which requires write permission on the directory. You also need execute permission on the directory to access or traverse it and reach the entry you want to delete. The file’s own permissions don’t control whether you can delete it. (Note: a sticky bit on a directory, common on shared dirs like /tmp, can restrict deletion of files owned by others even if you have write/execute on the directory.) So, the necessary permissions are write and execute on the directory.

Deleting a file is a change to the directory’s contents, not a change to the file itself. To remove an entry, you must be able to modify the directory, which requires write permission on the directory. You also need execute permission on the directory to access or traverse it and reach the entry you want to delete. The file’s own permissions don’t control whether you can delete it. (Note: a sticky bit on a directory, common on shared dirs like /tmp, can restrict deletion of files owned by others even if you have write/execute on the directory.)

So, the necessary permissions are write and execute on the directory.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy