Как защитить каталог от записи? [закрыто]

У меня есть некоторые каталоги и файлы, похожие на этот

drwxr-xr-x. 2 ss ss 4096 Oct  3  2004 backup

Обратите внимание на . в разрешениях.

Пользователь ss не может удалить этот каталог.

Вопрос

Как установить такую ​​защиту от записи и как отменить ее?

2
задан 3 June 2012 в 06:23
2 ответа

The . at the end of the permissions is probably not relevant here. It indicates ACLs and/or SElinux attributes apply. See this question for more details.

If the user ss cannot delete this directory it is probably because he does not have write permission on the parent dir of this backup dir.

Add write permission for user ss to the parent directory of the directory backup to allow removal.

Deleting a file or directory requires write directory to the parent directory because that is the file you are editing.

If user ss has write permissions on the parent directory and you are still unable to remove the directory check acls (using getfacl) and SELinux context (using ls -ldZ).

8
ответ дан 3 December 2019 в 08:56
getfacl backup
ls -lZ

Это покажет вам контекст SELinux и ACL. Может быть, это вам поможет.

0
ответ дан 3 December 2019 в 08:56

Теги

Похожие вопросы