Linux之檔案許可權

來源:互聯網
上載者:User

標籤:

現在查看一個檔案的資訊

[email protected]:/home/songl/test# ls -l a.out -rwxrwxr-x 1 songl songl 8565 May  5 07:45 a.out                                                
-    rwx  rwx  r-x              1               songl                 songl                 8565 May 5 07:45     a.out   
檔案許可權和類型   inode串連數 所有者 所屬使用者組 時間  檔案名稱
 更改指令chmod    更該指令chown  更該指令chgrp    



 

一般來說訪問檔案的身份有:

1、檔案所有者(owner)

2、使用者組(group)

3、其它人(others)        

          - rwx rwx r-x
表示檔案    所有者許可權   所屬使用者權限 其它使用者權限

  

 

改變檔案屬性的方法:

1、chgrp    [-R]    dir/file  改變檔案所屬使用者組,加上-R則連同子目錄下的所有檔案和目錄都更新

2、chown  [-R]    dir/file      改變檔案的所有者,加上-R則連同子目錄下的所有檔案和目錄都更新

3、chomd [-R]  abc dir/file  更改不同使用者的讀寫執行許可權

[email protected]:/home/songl/test# ls -l a.out -rwxrwxr-x 1 songl songl 8565 May  5 07:45 a.out[email protected]:/home/songl/test# chmod g-w a.out [email protected]:/home/songl/test# ls -l a.out -rwxr-xr-x 1 songl songl 8565 May  5 07:45 a.out[email protected]:/home/songl/test# chown root a.out [email protected]:/home/songl/test# ls -l a.out -rwxr-xr-x 1 root songl 8565 May  5 07:45 a.out[email protected]:/home/songl/test# chgrp root a.out [email protected]:/home/songl/test# ls -l a.out -rwxr-xr-x 1 root root 8565 May  5 07:45 a.out

 

Linux之檔案許可權

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.