你們在使用linux的時候,用ls -l命令查看文件的權限的時候,你可能會發現,這個權限的表示內容,已經與之前的版本不同了,後面多了一個點,這個點是幹嘛的呢?搜索了好久也沒有找到答案,非常鬱悶啊!因而乎就只能本身慢慢研究.linux
首先來看看我是如何找到答案的,這個也是個人思路,和你們分享一下.vim
一、直接在網上搜索,但都找不到答案.安全
二、懷疑會不會像域名同樣,來用個點來表示結尾呢?ide
三、懷疑這個多是和權限有關,想到了ACL和SELinux.spa
四、懷疑和文件系統有關,由於RHEL6已經用了EXT4.orm
這些都是我想到的,可能和這個點有關的,猜想是能夠的,但絕對不能誤導別人,因此我就一一來排除和驗證,最終獲得結果是:blog
這個點表示的是存在「SELinux的安全標籤」!ci
爲何會這樣,咱們來看如何得出來的結果.get
咱們用getenforce來查看SELinux的運行模式域名
[root@master ~]# getenforce
Enforcing
這說明SELinux是啓動的,OK,咱們來建立個文件
[root@master ~]# touch testfile
[root@master ~]# ls -l testfile
-rw-r--r--. 1 root root 0 Jan 16 23:06 testfile
咱們看到這個文件的權限後面是有點的.
下面咱們關閉這個SELinux,而後從新啓動系統
[root@master ~]# vim /etc/sysconfig/selinux
將
SELINUX=enforcing
改成
SELINUX=disabled
保存退出,從新啓動系統.
從新進入系統後,咱們再來看一下這個SELinux的運行模式
[root@master ~]# getenforce
Disabled
再來建立個文件
[root@master ~]# touch testfile1
比較一下這兩個文件
[root@master ~]# ls -l testfile*
-rw-r--r--. 1 root root 0 Jan 16 23:06 testfile
-rw-r--r-- 1 root root 0 Jan 16 23:10 testfile1
發現testfile1這個權限的後面沒有了點
再來看看這兩個文件的安全上下文是什麼樣的
[root@master ~]# ls -Z testfile*
-rw-r--r--. root root unconfined_u:object_r:admin_home_t:s0 testfile
-rw-r--r-- root root ? testfile1
關掉了SELinux,建立的文件就沒有了這個安全上下文了,也就沒有了這個點了.
咱們再看看,把SELinux開啓,再從新啓動電腦,看看這個testfile1的安全上下文會變成什麼樣?
[root@master ~]# ls -Z testfile*
-rw-r--r--. root root system_u:object_r:admin_home_t:s0 testfile
-rw-r--r--. root root system_u:object_r:admin_home_t:s0 testfile1
從新啓動後,這個testfile1文件就自動加上了這個安全標籤,並且權限的後面又多了一個點.