D
D
Denis Sechin2018-07-31 15:36:33
linux
Denis Sechin, 2018-07-31 15:36:33

Can't delete a folder that I own?

Why can't I delete the folder I own? I created the fff folder from sudo, made my own account A, set the rights to 700. Now I try to delete the fff folder under user A, writes permission denied. Although if user A creates a ddd folder with rights 700, he can delete it. But if you change the owner to the ddd folder and set permissions to 700, then user A can still delete this folder with a different owner. So, where is the distinction here?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
R
Rsa97, 2018-07-31
@Rsa97

To delete a file or directory, you must have full rights to the parent directory.
Privileges on a directory give permission to do something inside the directory, but not on the directory itself.

R
res2001, 2018-07-31
@res2001

The folder may not be deleted, for example, because it is open in another process.
In general, everything works the opposite of how you describe.
Conduct a real experiment and make sure that there is a distinction between rights.

R
Roman Ratkin, 2018-07-31
@Hanharr

If you create a subdirectory fff as root in user A's directory (/home/A). Then, do

sudo chmod 0700 /home/A/fff
sudo chown A:A /home/A/fff

And, now you can delete the fff subdirectory from user A without root rights. Those. to delete a subdirectory, you must also be the owner of the directory. Or, be a member of a group that has rwx permissions on the directory.

R
Ruslan Fedoseev, 2018-07-31
@martin74ua

create directory, delete directory, create file, delete file - write permission to the parent directory.

C
CityCat4, 2018-07-31
@CityCat4

Only root can change folder permissions. A non-root cannot delete a folder owned by another user. Basically.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question