精品专区-精品自拍9-精品自拍三级乱伦-精品自拍视频-精品自拍视频曝光-精品自拍小视频

網(wǎng)站建設(shè)資訊

NEWS

網(wǎng)站建設(shè)資訊

Linux文件/目錄的權(quán)限及歸屬管理精講

一、文件的權(quán)限和歸屬概述

1、訪問(wèn)權(quán)限

  • 讀取r:允許查看文件內(nèi)容、顯示目錄列表;

    成都創(chuàng)新互聯(lián)公司堅(jiān)信:善待客戶,將會(huì)成為終身客戶。我們能堅(jiān)持多年,是因?yàn)槲覀円恢笨芍档眯刨嚒N覀儚牟缓鲇瞥踉L客戶,我們用心做好本職工作,不忘初心,方得始終。10多年網(wǎng)站建設(shè)經(jīng)驗(yàn)成都創(chuàng)新互聯(lián)公司是成都老牌網(wǎng)站營(yíng)銷服務(wù)商,為您提供網(wǎng)站建設(shè)、網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、H5技術(shù)、網(wǎng)站制作、品牌網(wǎng)站設(shè)計(jì)微信小程序開發(fā)服務(wù),給眾多知名企業(yè)提供過(guò)好品質(zhì)的建站服務(wù)。

  • 寫入w:允許修改文件內(nèi)容,允許在目錄中新建、移動(dòng)、刪除文件或子目錄;

  • 可執(zhí)行x:允許運(yùn)行程序、切換目錄

2、歸屬(所有權(quán))

  • 屬主:擁有該文件或目錄的用戶賬號(hào);

  • 屬組:擁有該文件或目錄的組賬號(hào);

3、查看文件的權(quán)限和歸屬

Linux文件/目錄的權(quán)限及歸屬管理精講

4、chmod設(shè)置文件權(quán)限

chmod命令的基本語(yǔ)法格式如下:
Linux文件/目錄的權(quán)限及歸屬管理精講

應(yīng)用舉例:

[root@centos01 ~]# touch 1.txt     
[root@centos01 ~]# ll 
總用量 8
-rw-r--r--  1 root root    0 1月  11 22:27 1.txt
-rw-------. 1 root root 1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root 1603 10月 23 23:36 initial-setup-ks.cfg
[root@centos01 ~]# chmod u+x ./1.txt  
[root@centos01 ~]# ll
總用量 8
-rwxr--r--  1 root root    0 1月  11 22:27 1.txt
-rw-------. 1 root root 1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root 1603 10月 23 23:36 initial-setup-ks.cfg
[root@centos01 ~]# chmod u-x,g+x,o+w 1.txt   

[root@centos01 ~]# ll
總用量 8
-rw-r-xrw-  1 root root    0 1月  11 22:27 1.txt
-rw-------. 1 root root 1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root 1603 10月 23 23:36 initial-setup-ks.cfg
[root@centos01 ~]# chmod 755 1.txt  
[root@centos01 ~]# ll
總用量 8
-rwxr-xr-x  1 root root    0 1月  17 02:36 1.txt
-rw-------. 1 root root 1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root 1603 10月 23 23:36 initial-setup-ks.cfg

5、chown設(shè)置文件的歸屬

chown命令的基本語(yǔ)法格式如下:
Linux文件/目錄的權(quán)限及歸屬管理精講

應(yīng)用舉例:

[root@centos01 ~]# chown bob 1.txt  
[root@centos01 ~]# ll
總用量 8
-rwxr-xr-x  1 bob  root    0 1月  17 02:36 1.txt
-rw-------. 1 root root 1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root 1603 10月 23 23:36 initial-setup-ks.cfg
[root@centos01 ~]# chown :benet 1.txt  
[root@centos01 ~]# ll
總用量 8
-rwxr-xr-x  1 bob  benet    0 1月  17 02:36 1.txt
-rw-------. 1 root root  1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root  1603 10月 23 23:36 initial-setup-ks.cfg
[root@centos01 ~]# chown bob:benet 1.txt  
[root@centos01 ~]# ll
總用量 8
-rwxr-xr-x  1 bob  benet    0 1月  17 02:36 1.txt
-rw-------. 1 root root  1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root  1603 10月 23 23:36 initial-setup-ks.cfg

二、目錄的權(quán)限和歸屬

1、訪問(wèn)權(quán)限

Linux文件/目錄的權(quán)限及歸屬管理精講

2、歸屬(所有權(quán))

  • 屬主:擁有該目錄的用戶賬號(hào);

  • 屬組:擁有該目錄的組賬號(hào);

3、chmod設(shè)置目錄權(quán)限

chmod命令設(shè)置目錄權(quán)限的基本格式如下:
Linux文件/目錄的權(quán)限及歸屬管理精講

應(yīng)用舉例:

[root@centos01 ~]# chmod -R 755 benet/   
          
[root@centos01 ~]# ll
總用量 8
-rw-r-xrw-  1 root root    0 1月  11 22:27 1.txt
-rw-------. 1 root root 1572 10月 23 22:37 anaconda-ks.cfg
drwxr-xr-x  3 root root   18 1月  11 22:39 benet
-rw-r--r--. 1 root root 1603 10月 23 23:36 initial-setup-ks.cfg

4、chown設(shè)置目錄的歸屬

chown命令設(shè)置目錄歸屬的基本格式如下:
Linux文件/目錄的權(quán)限及歸屬管理精講

應(yīng)用舉例:

[root@centos01 ~]# chown -R bob:benet benet/   
   
[root@centos01 ~]# ll
總用量 8
-rw-r-xrw-  1 root root     0 1月  11 22:27 1.txt
-rw-------. 1 root root  1572 10月 23 22:37 anaconda-ks.cfg
drwxr-xr-x  3 bob  benet   18 1月  11 22:39 benet
-rw-r--r--. 1 root root  1603 10月 23 23:36 initial-setup-ks.cfg

三、權(quán)限掩碼umask

1、umask的作用

控制新建的文件或目錄的權(quán)限,默認(rèn)權(quán)限去除umask的權(quán)限就是新建的文件或者目錄的權(quán)限。

2、設(shè)置umask

umask 022

3、查看umask

umask

4、應(yīng)用舉例:

[root@centos01 ~]# umask  
0022
[root@centos01 ~]# umask 000  
[root@centos01 ~]# umask   
0000
[root@centos01 ~]# touch 2.txt   
[root@centos01 ~]# ll
總用量 8
-rwxr-xr-x  1 bob  benet    0 1月  17 03:48 1.txt
-rw-rw-rw-  1 root root     0 1月  17 03:48 2.txt    
-rw-------. 1 root root  1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root  1603 10月 23 23:36 initial-setup-ks.cfg
[root@centos01 ~]# umask 022       
[root@centos01 ~]# umask           
0022
[root@centos01 ~]# touch 3.txt        
[root@centos01 ~]# ll
總用量 8
-rwxr-xr-x  1 bob  benet    0 1月  17 03:48 1.txt
-rw-rw-rw-  1 root root     0 1月  17 03:48 2.txt
-rw-r--r--  1 root root     0 1月  17 03:49 3.txt 
-rw-------. 1 root root  1572 10月 23 22:37 anaconda-ks.cfg
-rw-r--r--. 1 root root  1603 10月 23 23:36 initial-setup-ks.cfg

———————— 本文至此結(jié)束,感謝閱讀 ————————


文章名稱:Linux文件/目錄的權(quán)限及歸屬管理精講
文章網(wǎng)址:http://m.jcarcd.cn/article/gdsshp.html
主站蜘蛛池模板: 欧美日韩不卡视频 | 成人精品| 欧美日韩欧 | 国产亚洲视品在线 | 日韩男女做性高清在 | 欧美在线视频第一页 | 精品偷拍欧美日韩 | www在线黄| 麻花天美星空mv免 | 日本高清一区二区 | 91视频网站入口 | 国产乱子伦高清对白 | 91aiai| 国产在线播放免费 | 国内精品免费视频 | 成人深夜影院 | 朋友的妈妈在线观看 | 91福利社区视频 | 国产欧美在线日韩 | 精品一线二线三线 | 91一区二区在线 | 日韩综合第一页 | 国产在线每日更新 | 欧美性精品h| 岛国成人免费大片在 | 海量资源每 | 国产区一区二区 | 国产网站91 | 国产特级婬片免费看 | 福利灾难电影 | 日韩电影中文字幕 | 国产91精 | 国产熟女一区 | 日本到成人免费网站 | 日韩视频在线播放 | 91网视频网站 | 成人一区二区三区 | 日韩欧美大片精品黄 | 国产一区精品视频 | 国产青草精 | 国产精品一区在线 |