Что означает точка в конце `-rw-r - r -`? Как вы устанавливаете это с `chmod`?

95151
Darrell Duane

Некоторые из файлов в моих каталогах под Linux имеют .в конце списка разрешений.

  • Что означает точка в конце -rw-r--r--?
  • Как вы устанавливаете это с chmod?
93

5 ответов на вопрос

103
Chris Jester-Young

Согласно ls.c(строка 3785), .означает ACL SELinux . ( +означает общий ACL .)

33
Alan

У меня такой же вопрос. Мне потребовалось некоторое время, чтобы найти это, пролистав страницу "man ls" сто раз (ну, может быть, не так часто), пока я наконец не увидел заметку в разделе СМ. ТАКЖЕ об использовании команды:

 info coreutils 'ls invocation' 

В разделе, описывающем «-l» (--format = long):

 Following the file mode bits is a single character that specifies whether an alternate access method such as an access control list applies to the file. When the character following the file mode bits is a space, there is no alternate access method. When it is a printing character, then there is such a method.  GNU `ls' uses a `.' character to indicate a file with an SELinux security context, but no other alternate access method.  A file with any other combination of alternate access methods is marked with a `+' character. 
10
Jon

Это означает, что файл имеет список доступа с SELinux. Ознакомьтесь с этой темой, в которой рассказывается, как разрешить редактирование / изменение файла http://ubuntuforums.org/showthread.php?t=1315684.

Это не работает для меня Josef Klimuk 5 лет назад 0
8
Pik Master

Это контекст SELinux. Пытатьсяls -Z /your/file

Цитируя мой man ls

 SELinux options:  --lcontext Display security context. Enable -l. Lines will probably be too wide for most displays.  -Z, --context Display security context so it fits on most displays. Displays only mode, user, group, security context and file name.  --scontext Display only security context and file name. 

Чтобы изменить это, попробуйте одну из следующих команд: chconили semanage fcontextилиrestorecon

Довольно аккуратно объяснено здесь: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_ilests

1
SiegeX

Скорее всего, это связано со списком контроля доступа (ACL), хотя я видел их только +как в rw-rw-rw-+. Возможно, это .означает отсутствие ACL для этого файла.

Вы можете попробовать набрать getfacl .в текущем каталоге, чтобы увидеть, какие элементы управления доступом могут иметь эти файлы.

Нет, точка не означает отсутствие ACL - см. Другие ответы Linker3000 13 лет назад 2

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